-
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
RUF004 is not autofixable #1038
Comments
It’s because sys isn’t imported, and we don’t have the ability to add it to the import list (yet) since edits are currently localized. |
(Or, that’s my guess — I’m on the subway :)) |
No worries :) Do you think it's something ruff can fix at some point? |
Yes absolutely! |
It’s tracked somewhat obliquely by #835 so I’m going to close this one out in favor of the existing issue. |
Sure no problem. I fixed it in our case by adding import sys manually and changing one exit to sys.exit(). Then ruff did autofix all the rest on its own ;) |
This is with ruff
0.0.155
Consider the following:
running ruff on it with RUF004 activated works and detects the problem.
But if you try to fix it with
ruff --fix
it does not autofix it. And afaics this should be autofixable.The text was updated successfully, but these errors were encountered: