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

Fine-grained ignore rules #6

Open
2 tasks
LiamPattinson opened this issue Jan 22, 2024 · 0 comments
Open
2 tasks

Fine-grained ignore rules #6

LiamPattinson opened this issue Jan 22, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@LiamPattinson
Copy link
Collaborator

It should be possible to ignore rules on a per-file and per-line basis.

  • To ignore rules per file, will need to add project-wide settings file first (Project-wide settings #5). It will be easier to handle this via a settings file or the command line than to parse comments in the files themselves.
  • Per-line ignores could be done the same way as flake8/ruff: search for a comment ! noqa at the end of a line. The regex !\w*noqa\w*$ should do it.
    • After gathering rule violations for a file, check the returned line numbers, and search for ! noqa on those lines. Discard violations wherever it's found.
    • Could also have fine-grained ignores, such as ! ignore: E123.
    • Things will get trickier if we also aim to account for line continuations with &.
@LiamPattinson LiamPattinson added the enhancement New feature or request label Jan 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant