You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Your feature request related to a problem? Please describe.
From time to time I need to add something to exclude-rules. For example I'm introducing new rule to old codebase so I exclude the rule in some files/folders and iteratively fixing it.
But sometimes I get to the point, that I fix all issues, but forgot to remove that entry in exclude-rules section.
Describe the solution you'd like.
It would be nice, if golangci-lint would complain that I have some rule to exclude, which is not applied at all.
I see that similar thing is now done by nolintlint when I have //nolint:xxx in the code. But not in the .golangci.yml file.
Describe alternatives you've considered.
No alternative considered. I saw it in linters for different languages than Go.
Additional context.
No response
The text was updated successfully, but these errors were encountered:
currently, it's not possible to do that because golangci-lint comes with default exclusion rules.
Those default rules are merged with the user's defined rules.
So golangci-lint will report a kind of false positive unused rules.
Also in some cases, exclusions should be kept even if they are not currently used:
exclusions related to specific OS and/or build tags
exclusions related to shared company rules
The solution to detect and report unused exclusions is more complex than just reporting those exclusions.
FYI, internally, it's completely independent of the processing of nolint directives.
Your feature request related to a problem? Please describe.
From time to time I need to add something to
exclude-rules
. For example I'm introducing new rule to old codebase so I exclude the rule in some files/folders and iteratively fixing it.But sometimes I get to the point, that I fix all issues, but forgot to remove that entry in
exclude-rules
section.Describe the solution you'd like.
It would be nice, if golangci-lint would complain that I have some rule to exclude, which is not applied at all.
I see that similar thing is now done by nolintlint when I have
//nolint:xxx
in the code. But not in the.golangci.yml
file.Describe alternatives you've considered.
No alternative considered. I saw it in linters for different languages than Go.
Additional context.
No response
The text was updated successfully, but these errors were encountered: