-
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
Incorrect replacement of unused variable with pass when followed by comment or empty line #82
Comments
I can confirm that this issue is still there. Also for imports: def some_function(self, args):
from tensorflow import reduce_logsumexp
result = args[0] --- original/test.py
+++ fixed/test.py
@@ -53,7 +53,7
def some_function(self, args):
- from tensorflow import reduce_logsumexp
+ pass
result = args[0] |
In my case, this behavior only happens when I pass the |
Right to the above comment, in which in my case, I want to pass the flag so I can keep the |
I'm seeing this behavior as well when using the |
I am also seeing this behavior when I use the |
When replacing an unused variable,
autoflake
is messed up by seeing an empty line or a comment, and considers that it's an empty function. This results in replacing the unused variable withpass
.Minimal Reproductible Example
1. With comment
2. With empty line
The text was updated successfully, but these errors were encountered: