Skip to content

detect unused //revive:disable comments #1534

@nobe4

Description

@nobe4

Is your feature request related to a problem? Please describe.

golangci-ships nolintlint, which -among other things- detects when a //nolint:<linter> is invalid.

The main case is when the problem was fixed, and the nolint should be removed.

This is great to keep track of exceptions and remove them whenever possible.

Describe the solution you'd like

I think revive should have the same.

Describe alternatives you've considered

I don't think golangci-lint actually does anything with //revive:disable comments, but only focuses on //nolint: ones. IMHO that makes sense, and revive should own its linter.

Additional context

I looked at implementing such a linter, but got stuck pretty early on because:

  • A linter is not aware of other linters.
  • A linter only has the file input as its parameter, nothing else.

No easy solution came to mind, so I decided to open this issue to see if it's something that could be considered.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions