ruff
ruff copied to clipboard
Implement flake8-noqa
flake8-noqa
Error codes
- [x]
NQA001"#noqa" must have a single space after the hash, e.g. "# noqa" - [x]
NQA002"# noqa X000" must have a colon, e.g. "# noqa: X000" - [x]
NQA003"# noqa : X000" must not have a space before the colon, e.g. "# noqa: X000"' - [ ]
NQA004"# noqa: X000" must have at most one space before the codes, e.g. "# noqa: X000" - [x]
NQA005"# noqa: X000, X000" has duplicate codes, remove X000 - [x]
NQA101"# noqa" has no violations - [x]
NQA102"# noqa: X000" has no matching violations - [x]
NQA103asRUF100"# noqa: X000, X001" has unmatched code(s), remove X001 - [x]
NQA104asPGH004"# noqa" must have codes, e.g. "# noqa: X000" (enable via noqa-require-code)
Flake8 specific rules
Should we ignore them?
- [ ]
NQA011"#flake8: noqa" must have a single space after the hash, e.g. "# flake8: noqa" - [ ]
NQA012"# flake8 noqa" must have a colon or equals, e.g. "# flake8: noqa" - [ ]
NQA013"# flake8 : noqa" must not have a space before the colon, e.g. "# flake8: noqa"
Options
- [x]
noqa-require-codeasPGH004: Require code(s) to be included in # noqa comments - [x]
noqa-no-require-code: Do not require code(s) in # noqa comments (default setting) - [ ]
noqa-include-name: Include plugin name in messages - [ ]
noqa-no-include-name: Do not include plugin name in messages (default setting)
We have NQA101, NQA102, and NQA103 as RUF100, but it'd be great to have better diagnostics around noqa validation.
NQA001 seems covered by E262
I'm gonna work on NQA002, NQA003, NQA004, and NQA005.
The functionality of NQA002 and NQA003 was added to PGH004
The functionality of NQA005 was added to RUF100
FYI @JonathanPlasse NQA001 and NQA005 should be checked in the summary, but NQA004 should be unchecked for now.
Okay, I think I corrected them.