Skip to content

Document expanded list of all linter rules #1767

Open
@sebastien-rosset

Description

@sebastien-rosset

Is your feature request related to a problem? Please describe.
It's difficult to sift through the list of rules across all linters.

  1. Sometimes a one-liner description at https://golangci-lint.run/usage/linters/ is sufficient because the linter implements a single rule.
  2. Some linters implement over 100 rules. For example, govet, gosec, staticcheck and go-critic have many rules.
  3. Some linters support extensible rules without recompilation.
  4. 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:

  1. Security
  2. Code simplifications
  3. Misuses of the standard library
  4. Concurrency issues
  5. Testing issues
  6. Code that isn't really doing anything
  7. Correctness issues
  8. Performance issues
  9. Dubious code constructs that have a high probability of being wrong
  10. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions