1
0
mirror of https://github.com/mgechev/revive.git synced 2024-11-28 08:49:11 +02:00
Commit Graph

71 Commits

Author SHA1 Message Date
sina safari
62db66915b
add new rule time equal (#584) 2021-10-01 13:55:53 +02:00
Oleg Butuzov
d7e3d5eac7
fix: time-naming issue #571 (#572)
resolves #571
2021-09-12 16:09:14 -07:00
SalvadorC
18cdb55850
Exported config (#565)
* working version

* adds flag for replacing "stutters"
2021-08-26 08:36:24 -07:00
SalvadorC
c939bb6af8
add new rule useless-break (#551) 2021-08-15 15:30:08 -07:00
SalvadorC
89f108c22a
fix issue #540 (#543) 2021-07-11 21:31:46 -07:00
SalvadorC
ea51f7aa3f
fix issue #537 (#538) 2021-06-29 13:04:51 -07:00
Robert Deusser
575ce5f61a
new rule: nested-structs (#530)
new rule: nested-structs
2021-06-15 11:36:41 +02:00
Keith Scroggs
2afe668e7b
Check string literals against regular expressions (#511)
Add string-format rule
2021-04-18 18:35:30 +02:00
SalvadorC
46f65914e3
new rule function-length (#504) 2021-03-20 15:45:30 -07:00
Minko Gechev
688024a5ca
Add revive linting action and fix linting errors (#455) 2020-08-15 00:50:13 +03:00
SalvadorC
1412d0c6ed
new rule: unexported-naming (#443)
* new rule: unexported-naming

* better failure message
2020-07-23 02:17:20 +03:00
chavacava
ad3100c9ec adds defer rule 2020-06-08 09:40:38 -07:00
chavacava
65beded8c4 Merge remote-tracking branch 'upstream/master' into unconditional-recursion 2020-05-13 22:13:08 +02:00
chavacava
91adb8bc8a first working version 2020-05-09 17:10:34 +02:00
chavacava
0c49c6a991 identical-branches initial implementation 2020-05-08 22:08:16 +02:00
SalvadorC
67c83886d7
Late return rule (#406)
* fisrt working version of late-return rule

* late-update: adds doc

* renames to early-return

* fix rule failure condition

* fix alphabetical sorting of early-return
2020-05-08 11:14:21 -07:00
SalvadorC
c469747758
renames fixtures as testdata to avoid spurious dependencies (#359) 2020-03-02 09:12:43 -10:00
Bernhard Reisenberger
22014c3f08
Add rule 'range-val-address' (#353)
* Add rule 'range-val-address'

* range-val-address: replace pick with visitor; avoid nesting; improve failure message

* range-val-address: not all callexprs are bad. limit to 'append'
2020-02-26 10:33:00 -10:00
SalvadorC
a24e8e7b81
String of int (#342)
* string-of-int: working version

* adds doc of string-to-int
2020-02-18 09:38:01 -08:00
SalvadorC
2bec93f05f fixes issue 290 (#294) 2020-01-07 14:46:21 -08:00
chavacava
611c6f7c81 firts working version 2019-12-14 08:27:06 +01:00
dshemin
98b0cb55b7 Revert benchmark code 2019-11-28 10:19:08 +07:00
dshemin
9bb943735e Fix review comments 2019-11-28 10:14:21 +07:00
dshemin
3c93b9c1a4 Fix #245 File header rule: index out of range [0] with length 0 2019-11-28 01:38:43 +07:00
SalvadorC
c8ee35a500 adds blacklist to unhandled-error (#128)
* adds blacklist for unhandled-error

* uses ignoreList in place of blackList
2019-04-29 19:56:12 -07:00
SalvadorC
8aa0cd8bd4 unhandled-error (new rule) (#124)
* unhandled-error (new rule)

* better failure msg

* encapsulates error type detection
2019-04-27 19:23:17 -07:00
SalvadorC
e8c1baf8ac optimizes import-blacklist (#123) 2019-04-22 10:58:02 -07:00
SalvadorC
2474f6cecb simpler and more efficient implementation of unused-parameter (#121) 2019-04-21 10:13:03 -07:00
SalvadorC
00a86ae1fd new rule: unused-receiver (#119)
* new rule: unused-receiver

* unused-receiver: adds more test cases
2019-04-18 10:35:51 -07:00
SalvadorC
745bcf65aa bare-return (first working version) (#117)
New rule bare-return
2019-04-17 22:55:52 +02:00
SalvadorC
2ce440cf96 new rule: import shadowing (#114)
* Adds rule superfluous-else (an extension of indent-error-flow)

* Fix superfluous-else rule struct namming.

* Adds superfuous-else rule to the rules table

* Adds confusing-naming rule

* adds multifile test

* clean-up

* fix config.go

* clean master

* new ADS rule: newerr

* ADS-print working version

* ads-print final version

* ads-lost-err working version

* fix ads-print

* removes ads rules from master

* new rule: import-shadowing

* removes ads rules from master

* new rule: import-shadowing

* fix defaults

* adds explanations on the rule implementation
2019-03-27 11:46:20 -07:00
SalvadorC
fbefad8558 New rule: duplicated-imports (#111)
* Adds rule superfluous-else (an extension of indent-error-flow)

* Fix superfluous-else rule struct namming.

* Adds superfuous-else rule to the rules table

* Adds confusing-naming rule

* adds multifile test

* clean-up

* fix config.go

* clean master

* new ADS rule: newerr

* ADS-print working version

* ads-print final version

* ads-lost-err working version

* adds duplicated-imports rule

* adds duplicated-imports rule
2019-03-20 11:54:03 -07:00
SalvadorC
202adf0786 Fix 102 (#103)
Do not require additional newline for disabling multiple rules
2019-01-24 09:14:43 -08:00
SalvadorC
55fe366696 call-to-gc (new rule) (#90) 2018-10-31 07:32:23 -07:00
xuri
3c177e2824 New rule: line-length-limit (#86)
* New rule: line-length-limit

* simplify the panic message of rule line-length-limit

* Refactors `line-length-limit` rule, use private `check` method instead of `Visit`
2018-10-19 08:18:33 -04:00
Genadi Samokovarov
d2e0e5a0ed Introduce the empty-lines rule that verifies there are no {head,trail}ing lines (#81) 2018-10-11 14:52:46 -07:00
xuri
7d2c43c827
Rename rule name waitgroup-by-copy to waitgroup-by-value 2018-10-03 16:01:41 +08:00
xuri
9545122d39 New rule: atomic (#77) 2018-10-01 12:24:17 -07:00
SalvadorC
6ebe5bbb1e waitgroup-by-value (new rule) (#76)
* waitgroup-by-value (new rule)

* code simplification
2018-09-30 12:29:11 -07:00
xuri
924e3db3ba
Rename rule range-loop-var to range-val-in-closure. 2018-09-29 11:32:32 +08:00
xuri
b34a6c053e
New rule: range-loop-var 2018-09-27 23:21:10 +08:00
SalvadorC
388baa3eeb Fix linter warnings (recommended config) in the code (#71) 2018-09-22 15:27:22 -07:00
Sylvain Kerkour
02575a7674 Add the imports-blacklist rule (#68)
* Add the imports-blacklist rule with tests

* Add the imports-blacklist rule to README.md

* Update the imports-blacklist rule to use map[string]bool so that we can have the algorithm in Visit below with O(n) instead of O(n*m)

* Fix the imports-blacklist rule to be case sensitive
2018-09-17 13:06:42 -07:00
SalvadorC
7240bd56d0
Merge pull request #62 from xuri/return-value-limit
New rule: return-result-limit
2018-09-17 21:56:59 +02:00
xuri
dd1a8bf4e6
Add test case for function-result-limit rule, and updated README 2018-09-17 18:50:04 +08:00
mgechev
90f51530cc
Add white & black lists for var-naming
This PR introduces a white & black lists of initialisms for the
`var-naming` rule.

Now the rule can be configured with:

```toml
[rule.var-naming]
  arguments = [["ID"], ["VM", "BAR"]]
```

This way, the linter will ignore `customId` but will throw on `customVm` or `customBar`.

Fix #41
2018-09-15 15:05:31 -07:00
SalvadorC
f004425b6e redefines-builtin-id (new rule) (#60) 2018-09-13 19:19:49 -07:00
SalvadorC
81bdff4472 constant-logical-expr (new rule) (#55)
* suspicious-logical-expr (new rule)

* renames 'suspicious-logical-expression' to 'constant-logical-expression'
2018-08-23 11:45:10 -07:00
SalvadorC
771aa23069 bool-literal-in-expr (new rule) (#54)
* bool-literal-in-expr (new rule)

* bool-literal-in-expr: add test case and fix typo
2018-08-23 11:10:17 -07:00
SalvadorC
613fd24a3b modifies-value-receiver (new rule) (#51) 2018-08-13 15:18:28 -07:00