File-scoped flake8: noqa
directive with comment is not recognized
#10239
Labels
suppression
Related to supression of violations e.g. noqa
As per Ruff's documentation, this is treated the same as
# ruff: noqa
, which doesn't allow comments. However,flake8
does allow comments - and I happen to believe comments should be required any time some/all rules are disabled to explain why. This particular comment is in fact being used to disableflake8
for this file. The author would have liked to also disable Ruff for the whole file, but didn't realize that the comment could do both due to the comment, and ended up disabling the particular line with a Ruff violation.This came to my attention when I upgraded to Ruff v0.3.0 (I'm very excited to try the new formatting, by the way!). I ran
ruff check
and got a warning every time:Ideally, comments would be allowed on
ruff: noqa
. But even if not, Ruff should not be warning about a validflake8
directive.The text was updated successfully, but these errors were encountered: