1
0
mirror of https://github.com/mgechev/revive.git synced 2025-03-25 21:29:16 +02:00

52 Commits

Author SHA1 Message Date
chavacava
60e1ae4a01
adds checks for protobuf struct tags ()
* adds checks for protobuf struct tags

* use actual tag numbers as key instead of strings
removes debug println
2022-07-15 11:15:55 -07:00
chavacava
e9d5b48c19
fix () 2022-07-14 15:15:42 +02:00
hulk
8dd3945eaf
Check whether the tag name is duplicate or not ()
* Check whether the tag name is duplicate or not

* - minor refactoring
- continues checking tag even if name is repeated

* adds test cases for duplicated tag names

* adds test case with two tag types (json & yaml)

* Fix allow the same tag name in different tag key

* fix checks on protobuf tag names

Co-authored-by: chavacava <salvadorcavadini+github@gmail.com>
2022-07-13 20:26:44 +02:00
hulk
ce7f0669d3
Allow to customize user functions in rule error-strings ()
* Allow to customize user functions in rule `error-strings`

* Rollback the Available Rules table format in README

* adds memoization of the rule's configuration

Co-authored-by: chavacava <salvadorcavadini+github@gmail.com>
2022-07-05 21:51:50 +02:00
chavacava
2aac974b5c
fix issue () 2022-06-28 18:14:26 +03:00
okhowang
387d7276a1
Make package comment more confident () 2022-06-19 13:21:31 +02:00
Ivan Trubach
dc30eb1182
fix(receiver-naming): distinguish types with parameters ()
* fix(receiver-naming): distinguish types with parameters

* chore: run tests using supported Go versions matrix
2022-06-18 18:47:53 +02:00
Yudai Takada
e10678fea5
Fixes issue imports-blacklist support regex ()
* Fixes issue  imports-blacklist support regex

* refactors method name and error message

* restores original test cases

Co-authored-by: chavacava <salvadorcavadini+github@gmail.com>
2022-04-21 16:04:00 +02:00
chavacava
a67ecdd7ba
add rule datarace () 2022-04-18 09:45:42 -07:00
Markus Zimmermann
b9814276b6
Remove built-in types that existing only for the Go documentation ()
Since these types only exist for documenting Go's standard library there
should be no reason to mark them.

Closes 
2022-04-08 15:18:18 +02:00
chavacava
b6c86a274f
fix issue 664 () 2022-03-31 17:40:26 +02:00
chavacava
671c55d82e
adds rule use-any () 2022-03-29 11:25:38 -07:00
chavacava
fa939adbf0
Adds support for new type alias any in the rule redefines-built-in ()
* adds support for any type alias

* adds more representative tests
2022-03-29 10:51:01 +02:00
Bernhard Reisenberger
f335f9792d
range-val-address: improve detection () 2022-03-12 09:32:57 +01:00
subham sarkar
54d9a09ab5
Incorrect handling of token.{LEQ,GEQ} for constant-logical-expr ()
* fix: incorrect handling of token.{LEQ,GEQ} for constant-logical-expr lint

Signed-off-by: subham sarkar <sarkar.subhams2@gmail.com>

* tiny modification in comments

Co-authored-by: chavacava <salvadorcavadini+github@gmail.com>
2022-02-27 09:37:51 +01:00
chavacava
d4fbc92440
fix issue () 2022-02-15 22:46:24 +01:00
Oleg Butuzov
6545203e2d
refactor(cyclomatic): improved message for cyclomatic rule () 2022-01-31 17:33:43 +01:00
chavacava
b721f69625
fix (Rule 'var-naming' should allow Fuzz_xxx) () 2022-01-18 15:26:29 +01:00
Euan Kemp
af953e6189
Allow whitelist for the context parameter check ()
* Allow a whitelist for the context parameter check

This allows users to configure a set of types that may appear before
`context.Context`.

Notably, I think this rule is useful for allowing the `*testing.T` type
to come before `context.Context`, though there may be other uses (such
as putting a tracer before it, etc).

See  for a little more context on this.

Fixes 

* Save a level of indentation in context-as-arg validation

We can unindent if we make the above check more specific

* refactoring taking into account chavacava's review

Co-authored-by: chavacava <salvadorcavadini+github@gmail.com>
2021-12-31 17:11:18 -08:00
doniacld
faba17a90f
Fix package check in error-strings rule () ()
Co-authored-by: SalvadorC <salvadorcavadini+github@gmail.com>
2021-10-30 08:45:37 +02:00
doniacld
0fada9d76c
Update error-strings rule () ()
Co-authored-by: SalvadorC <salvadorcavadini+github@gmail.com>
2021-10-28 21:26:02 +02:00
doniacld
5d04216294
Add optimize-operands-order rule () ()
Co-authored-by: SalvadorC <salvadorcavadini+github@gmail.com>
2021-10-23 09:29:14 +02:00
chavacava
55e1594efd fixes false positive in unconditional-recursion 2021-10-15 13:14:03 -07:00
doniacld
be81121399
Add banned characters rule () () 2021-10-14 20:56:29 +02:00
sina safari
62db66915b
add new rule time equal () 2021-10-01 13:55:53 +02:00
Oleg Butuzov
d7e3d5eac7
fix: time-naming issue ()
resolves 
2021-09-12 16:09:14 -07:00
SalvadorC
18cdb55850
Exported config ()
* working version

* adds flag for replacing "stutters"
2021-08-26 08:36:24 -07:00
Bernhard Reisenberger
406b1ce110
range-val-address: fix false positive ()
range-val-address: fix false positive (closes )
2021-08-26 08:41:58 +02:00
SalvadorC
28559501d3
fix issue 556 () 2021-08-16 12:15:17 +02:00
SalvadorC
c939bb6af8
add new rule useless-break () 2021-08-15 15:30:08 -07:00
SalvadorC
98c374dcad
add tests on common methods handling () 2021-07-28 17:59:55 +03:00
SalvadorC
89f108c22a
fix issue () 2021-07-11 21:31:46 -07:00
SalvadorC
ea51f7aa3f
fix issue () 2021-06-29 13:04:51 -07:00
SalvadorC
cfac8b0013
fix 534 ()
Closes 
2021-06-29 21:40:40 +02:00
Robert Deusser
575ce5f61a
new rule: nested-structs ()
new rule: nested-structs
2021-06-15 11:36:41 +02:00
SalvadorC
97ef50d9f7
fix 525 () 2021-05-25 15:09:05 -07:00
Bernhard Reisenberger
3bac05c7a4
range-val-address: improve detection ()
range-val-address: improve detection
2021-05-03 14:22:35 +02:00
Keith Scroggs
2afe668e7b
Check string literals against regular expressions ()
Add string-format rule
2021-04-18 18:35:30 +02:00
SalvadorC
46f65914e3
new rule function-length () 2021-03-20 15:45:30 -07:00
Jakub Chábek
535f426fb8
Ignore blank import of embed if embed is actually used in the file ()
* Ignore blank import of embed
2021-03-06 14:04:57 +01:00
SalvadorC
fcccdca4e3
fixes issue () 2020-08-05 19:25:57 +03:00
SalvadorC
1412d0c6ed
new rule: unexported-naming ()
* 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
e9bdc9ed8f removes type-checking from empty-block rule 2020-05-20 12:05:56 -07:00
chavacava
7787615901 adds test cases for ranges 2020-05-13 23:42:51 +02:00
chavacava
65beded8c4 Merge remote-tracking branch 'upstream/master' into unconditional-recursion 2020-05-13 22:13:08 +02:00
SalvadorC
1da965b65f
fix issue 386: Incorrectly identifies channel draining as "empty code… ()
* fix issue 386: Incorrectly identifies channel draining as "empty code block"

* updates doc of empty-block rule
2020-05-10 17:43:56 -07:00
chavacava
7a55cafc36 adds support for control exit statements 2020-05-09 21:43:12 +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