Skip to content

enable/disable "fix" per linter #3366

Open
@pierrre

Description

@pierrre

Your feature request related to a problem? Please describe.

I'm using the "fix" option, so golangci-lint automatically fixes issues when I run it.
But it's a problem for the nolintlint linter, because I use the allow-unused: false option.
Sometimes, when I'm working on lint issues, a //nolint comment doesn't match a lint issue. (but it should)
And with the "fix" option, the comment is automatically deleted.

It's also real problem while working on custom ruleguard rules.
While I'm building a rule, sometimes the syntax is not perfectly right, so the //nolint comments are deleted everywhere in my project.

Describe the solution you'd like.

I would like to be able to enable/disable the "fix" option per linter.

Describe alternatives you've considered.

We could also allow to disable "fix" for the nolintlint linter, but I think it's better to be able to enable/disable for all linters.

Additional context.

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or improvementno decisionNo decision to fix or not

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions