-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
unused-noqa
(RUF100
) - false negatives and strange behavior with multiple codes
#15682
Comments
Thanks, I think we miss a check for ruff/crates/ruff_linter/src/noqa.rs Lines 105 to 128 in c39ca8f
|
See also #12809 and #14229. I posted a comment at the latter, but perhaps Charlie never saw it. @MichaReiser Considering what happened in the two aforementioned PRs, this will require a design decision. What do you say? |
Can you tell me more about the design decisions you see? These could also be multiple fixes:
|
@MichaReiser #12809 made it so that # This hides the two diagnostics
print(list(sorted())) # noqa: T201C413 # This doesn't, and the joint code is not reported as invalid.
# ruff: noqa: T201C413
print(list(sorted())) My question never got an answer, so I assume that it is desired to keep this inconsistency. If you say otherwise, I can work on a fix. The PR will have concrete examples as well as how to deal with those and we can go from there. |
Description
i assume this is an unintentional bug in the logic that allows you to add additional information to noqa comments:
# noqa: D103 this function is self-documenting
but ruff should enforce a space between the code and any additional comments. currently it doesn't seem to do so. it also seems to allow certain completely invalid codes:
interestingly, these are treated as two separate codes:
i think it should instead be an error and force the user to separate them with a comma like this:
https://play.ruff.rs/2b3608e9-f97a-459a-960b-f702827ef4e4
The text was updated successfully, but these errors were encountered: