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

isort==5 regression: force_single_line removes preceding comment lines #1296

Closed
nchepanov opened this issue Jul 7, 2020 · 1 comment
Closed

Comments

@nchepanov
Copy link

nchepanov commented Jul 7, 2020

Given

an example.py:

# A comment
# A comment

# Oh no, I'm gone :'(
from moo import foo

Observed

➜ isort --diff --check --force-single-line-imports example.py
ERROR: example.py Imports are incorrectly sorted and/or formatted.
--- example.py:before	2020-07-07 10:51:36.483557
+++ example.py:after	2020-07-07 10:51:44.531403
@@ -1,5 +1,4 @@
 # A comment
 # A comment

-# Oh no, I'm gone :'(
 from moo import foo

Expected

The comment is not deleted, as it was with isort==4.3.21

➜ pip freeze
isort==4.3.21
➜ isort --diff --check --force-single-line-imports example.py
(success)

Environment:

➜ pip freeze
isort==5.0.4
➜ python --version
Python 3.8.1
@timothycrosley
Copy link
Member

Thanks for reporting! I'm sorry this issue impacted you!
isort 5.0.5 has been released that fixes this issue with additional regression tests in place to ensure it doesn't resurface.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants