Description
Is your feature request related to a problem? Please describe.
It's difficult to sift through the list of rules across all linters.
- Sometimes a one-liner description at https://golangci-lint.run/usage/linters/ is sufficient because the linter implements a single rule.
- Some linters implement over 100 rules. For example,
govet
,gosec
,staticcheck
andgo-critic
have many rules. - Some linters support extensible rules without recompilation.
- Some linters seem to be somewhat redundant, maybe because it's difficult to get the complete list of checks.
Describe the solution you'd like
Provide a searchable list of all linter rules with categories or tags.
Each linter would somehow register all the rules it implements with rule-name
, tags
, doc
.
For example:
Name: G101, Tags: security, Doc: Look for hard coded credentials
Name: G102, Tags: security, Doc: Bind to all interfaces
Name: ST1008, Tags: Stylistic issues, Doc: A function's error value should be its last return value
Name: ST1011, Tags: Stylistic issues, Doc: Poorly chosen name for variable of type time.Duration
A starting point for the list of tags is to use staticcheck and go-critic:
- Security
- Code simplifications
- Misuses of the standard library
- Concurrency issues
- Testing issues
- Code that isn't really doing anything
- Correctness issues
- Performance issues
- Dubious code constructs that have a high probability of being wrong
- Stylistic issues
Describe alternatives you've considered
The list of all supported linters is documented here: https://golangci-lint.run/usage/linters/.
Each linter entry in the documentation has a link to the linter github page. So it's possible to manually explore all linter checks, read the documentation of each linter and then decide which linters and which linter checks to use.