-
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
noqa
comment stripped due to syntax error elsewhere in file
#4849
Comments
Thanks, I actually thought we added handling for this case at some point. Will revisit! |
I know, I have reported something similar before: Not sure what caused this one to resurface. |
(I believe this regressed when we started generating fixes on every pass, regardless of whether they're applied.) |
@MichaReiser - Any opinion on the right behavior here? The issue is that if we hit a syntax error, we fail to identify the W505 violation in the example above, and so the We could...
|
@charliermarsh My preference is 3. The way I think about this is that rules should only run if their input is correct. What the input is, differs from rule to rule:
That's why I think RUF100 should not run if any of the other phases returned an |
For what it's worth, I also believe 3 is the way to go. I don't like all the linting violations popping up in seemingly unrelated places while I'm writing some code. |
Sounds good, will fix today. |
Ruff indicates an unused noqa statement, when in fact it's fine. There is a syntax error in the function definition that triggers this, if the
*
is removed, everything is fine.This is on ruff version
0.0.270
.The text was updated successfully, but these errors were encountered: