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

Extra newline before comment with -n --fss, 5.0.5+ regression #1315

Closed
scop opened this issue Jul 13, 2020 · 2 comments
Closed

Extra newline before comment with -n --fss, 5.0.5+ regression #1315

scop opened this issue Jul 13, 2020 · 2 comments
Labels
bug Something isn't working
Milestone

Comments

@scop
Copy link
Contributor

scop commented Jul 13, 2020

isort 5.0.5 and later (up to 5.0.9) adds a spurious newline before a comment in the following scenario with -n --fss:

$ cat t.py
import sys

# Comment canary
from . import foo
$ isort -n --fss t.py 
Fixing /tmp/t.py
$ cat t.py
import sys


# Comment canary
from . import foo

There shouid be only one newline between import sys and # Comment canary. 5.0.4 and earlier did not have this problem. It is also somehow specific to both -n and --fss being specified; neither alone triggers the issue.

@timothycrosley timothycrosley added this to the 5.1.0 milestone Jul 14, 2020
@timothycrosley timothycrosley added the bug Something isn't working label Jul 14, 2020
@timothycrosley
Copy link
Member

A fix for this has been deployed to PyPI in the 5.1.0 release,

Thanks for reporting!

~Timothy

@scop
Copy link
Contributor Author

scop commented Jul 15, 2020

Thanks; that case is fixed indeed but there are some other related ones lurking, see #1322

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