-
-
Notifications
You must be signed in to change notification settings - Fork 0
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
run python thru ruff check --fix --unsafe-fixes
#106
base: master
Are you sure you want to change the base?
Conversation
I just randomly looked at one of the proposed changes, which is removing the
While changing things like |
All the |
You probably look wrong branch. Such line does not exist.
As mentioned in irc, == does type conversion. |
That is case of tool not being able to prove that statement has no side effects. Person would delete entire line. |
I don't know for sure that these changes are wrong. I only know they look suspicious, because they're deleting assignments. You'll need to check that the assigned variables are truly unreferenced after being assigned. Also, in at least some cases, if you can determine they're unreferenced, you'll want to delete the whole line instead of only the assignment.
The line does exist, but in an entirely different function which does the exact same assignment just before it.
I don't think it does type conversion, but in Python, booleans are an instance of int (probably for compatibility reasons). So the value of |
About the removed assignments: does python have a way to mark things as intentionally unused? I'm thinking about how in C, there are casts to |
I don't know of any such thing, no. Other than the convention of using |
Well, I think I'll give it a try anyways to see if |
Normally you'd only use |
As with cooljeanius/apple-gdb-1824#79, I'm going to have to read up on
ruff
's documentation to learn why it labels these particular fixes as "unsafe"...