-
Notifications
You must be signed in to change notification settings - Fork 21
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
Extra blank lines after imports are removed #219
Comments
Hi @nyuszika7h thanks for taking the time to open the issue. I see your point and agree it should be fixed. Sadly I don't have time to implement this on my own, but if anyone is interested in contributing I think the easier way to do it is by implementing some logic when the different parts of the code are joined so that if the |
Available since |
Description
autoimport removes extra blank lines after imports, even when it’s required for PEP 8 compliance (e.g. when imports are directly followed by a
class
or adef
). And also I like doinglines_after_imports = 2
in isort for consistency anyway.While you may say I can just run another auto-formatter afterwards to fix the issue, this actually makes it impossible to use autoimport as a pre-commit hook, as on the next run autoimport will remove the blank line again, and pre-commit requires all hooks to succeed.
Steps to reproduce
autoimport foo.py
Current behavior
The file gets rewritten to this:
Desired behavior
The file should remain untouched.
Environment
The text was updated successfully, but these errors were encountered: