We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I have a sample bad_code.py script below:
bad_code.py
import os # unused import import abc unused_var = 1 print("hello world")
And I run it with the command:
autoflake --in-place --remove-unused-variables --remove-all-unused-imports bad_code.py
However, the unused_var variable is not deleted :/
The text was updated successfully, but these errors were encountered:
I would say it makes sense it isn't removed, as unused_var has global scope here.
unused_var
If that code was in a library foo, then unused_var could be accessed with foo.unused_var which might be part of it's api, hence not safe to remove.
foo
foo.unused_var
If you had
import os # unused import import abc def fun(): unused_var = 1 print("hello world")
then it would be removed, as it's a local variable (which could not be accessed outside fun)
fun
Sorry, something went wrong.
No branches or pull requests
I have a sample
bad_code.py
script below:And I run it with the command:
However, the unused_var variable is not deleted :/
The text was updated successfully, but these errors were encountered: