Using ruff alongside flake8-noqa #3580
-
I am working on a project where we're using both ruff and flake8 (with the flake8-noqa) plugin. Consider the following code: # test.py
text = "Русский" Running ruff with ruff check --select RUF001 test.py
test.py:1:9: RUF001 [*] String contains ambiguous unicode character `Р` (did you mean `P`?)
test.py:1:10: RUF001 [*] String contains ambiguous unicode character `у` (did you mean `y`?)
test.py:1:11: RUF001 [*] String contains ambiguous unicode character `с` (did you mean `c`?)
test.py:1:12: RUF001 [*] String contains ambiguous unicode character `с` (did you mean `c`?)
Found 4 errors. If I attempt to silence the warning by modifying the file: # test.py
text = "Русский" # noqa: RUF001 Then running flake8 with the flake8-noqa plugin gives us: flake8 test.py
test.py:1:19: NQA102 "# noqa: RUF001" has no matching violations It would be great if ruff could be disabled on a line with something like |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
Yeah there's not a great solution to this right now. We do support the opposite thing, which is that if you use Ruff's |
Beta Was this translation helpful? Give feedback.
Yeah there's not a great solution to this right now. We do support the opposite thing, which is that if you use Ruff's
RUF100
rule instead offlake8-noqa
, you can mark codes that Ruff doesn't know about as "allowed" via theexternal
setting.