Implement //nolint parsing similar to golangci-lint (#3562)
* Implement //nolint parsing similar to golangci-lint
Look for nolint comments and collect the ranges of where they apply. If
a node immediately follows a range with the same column, expand the
range to include the node.
Add tests that verify errors are filtered out.
* Use a map instead of custom Linters type
Inline the new report function and add some comments about nolint
ranges.
* Add separate tests for various filters
Include a failing test that shows the column issue. Will work on a fix.
* Use ast.CommentMap to associate comments to nodes
This is better than the logic used by golangci-lint in that it does not
incorrectly attribute an inline comment with the next line if it
contains an ast.Node with a matching column (see inline_column test).
* Address PR feedback
Use table driven tests and `CombinedOutput`.
---------
Co-authored-by: Patrick Scott <patrick.scott@observeinc.com>
7 files changed