* Yet more bad defer / recover patterns
`recover()` is an eternal font of excitement.
* demonstrating another flavor of failure
* removing leftover code
* update documentation
* removes test not related to the rule itself
Co-authored-by: chavacava <salvadorcavadini+github@gmail.com>
* 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>
* 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>
Setting the entire file AST as the node causes golangci-lint to print
the entire file source as the context, and line and column numbers set
to 1. Point to the package name node instead.
Closes#688
* Fixes issue #619 imports-blacklist support regex
* refactors method name and error message
* restores original test cases
Co-authored-by: chavacava <salvadorcavadini+github@gmail.com>
Noticed during migration from our heavily modified "go-lint" to "revive" that there is an additional line printed. I am unsure that the convention for this project is on this, we do not allow adding such a call.
* 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 #605 for a little more context on this.
Fixes#605
* 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>