Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement //nolint parsing similar to golangci-lint #3562

Merged
merged 5 commits into from
Jun 7, 2023

Commits on Jun 5, 2023

  1. 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.
    obs-gh-patrickscott committed Jun 5, 2023
    Configuration menu
    Copy the full SHA
    7317ed1 View commit details
    Browse the repository at this point in the history
  2. Use a map instead of custom Linters type

    Inline the new report function and add some comments about nolint
    ranges.
    obs-gh-patrickscott committed Jun 5, 2023
    Configuration menu
    Copy the full SHA
    772261b View commit details
    Browse the repository at this point in the history
  3. Add separate tests for various filters

    Include a failing test that shows the column issue. Will work on a fix.
    obs-gh-patrickscott committed Jun 5, 2023
    Configuration menu
    Copy the full SHA
    da7819e View commit details
    Browse the repository at this point in the history
  4. 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).
    obs-gh-patrickscott committed Jun 5, 2023
    Configuration menu
    Copy the full SHA
    8dfd83e View commit details
    Browse the repository at this point in the history
  5. Address PR feedback

    Use table driven tests and `CombinedOutput`.
    obs-gh-patrickscott committed Jun 5, 2023
    Configuration menu
    Copy the full SHA
    a66f2f3 View commit details
    Browse the repository at this point in the history