Skip to content
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

Insertion of line between comment and constant just after imports with --float-to-top #1667

Closed
PeterJCLaw opened this issue Feb 14, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@PeterJCLaw
Copy link

Given the following code:

import sys

sys.path.insert(1, 'path/containing/something_else/..')

import something_else  # isort:skip

# Some constant
SOME_CONSTANT = 4

Which I believe is laid out correctly, isort (with --float-to-top enabled) will insert an empty line between the comment line and the constant which it relates to:

$ isort --float-to-top --diff foo.py 
--- /tmp/foo.py:before	2021-02-14 10:50:50.624101
+++ /tmp/foo.py:after	2021-02-14 10:51:37.301972
@@ -5,6 +5,7 @@
 import something_else  # isort:skip
 
 # Some constant
+
 SOME_CONSTANT = 4
@timothycrosley timothycrosley added the bug Something isn't working label Mar 3, 2021
@PeterJCLaw
Copy link
Author

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants