-
Notifications
You must be signed in to change notification settings - Fork 82
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
ignore-pass-statements introduces unnecessary pass statements #206
Comments
Yeah, removed imports are always replaced with |
@fsouza do we know why this is happening and is anyone taking a look? If not, I can try to dig deeper into figuring out what is going on here. |
Oh, it's just how it works, it's an accident of the design: to guarantee that the code is valid after the removal of the import, autoflake plays safe and puts a Lines 657 to 661 in 60eeb31
We can reuse the logic to determine whether a pass can be removed to safely remove the import, or have a way to identify which No one is currently working on this, feel free to take a stab! |
I intend to take a swing at this. My approach:
I think this is good enough for now. If we want to address fancier features like #234: removing newly-empty (Side note: I think #234 as mentioned above is in the same boat as #52). |
Is there any update on this? |
If "--ignore-pass-statements" is used, removed imports are being replaced with
pass
.This looks like a bug.
The text was updated successfully, but these errors were encountered: