Add nolintlint linter as internal linter #837
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a rework of #740 with the
nolintlint
package moved into golangci-lint. This also tries to address #832. It works by creating possible unused issues in thenolintlint
linter and then filters them out in thenolint
processor. I realize this is a debatable approach to the problem but it does allow the decoupling of analysis and the nolint processor (and inadvertently allows caching of the nolintlint analysis).The alternate approach to this is to move all the logic into the nolint processor. I'd be happy to do that if that is the preferred approach. Please let me know your thoughts.
Finally, this PR removes all the unused nolint statements in golangci-lint. That could be done in another PR but it is interesting to see what the effect of this is.