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 removes some imports when a comment is used #1741

Closed
adamsol opened this issue Jun 4, 2021 · 2 comments
Closed

isort removes some imports when a comment is used #1741

adamsol opened this issue Jun 4, 2021 · 2 comments
Labels
bug Something isn't working

Comments

@adamsol
Copy link

adamsol commented Jun 4, 2021

The issue seems to happen when a comment breaks the configured line length limit.

With this configuration:

[settings]
line_length = 50
multi_line_output = 2

a line like this (54 characters long):

from src import abcd, qwerty, efg, xyz  # some comment

is transformed to:

from src import abcd, efg      # some comment
@timothycrosley timothycrosley added the bug Something isn't working label Jun 5, 2021
@timothycrosley
Copy link
Member

So sorry you experienced this! Thank you for reporting. This is the nastiest bug I've seen slip through in years. Was able to confirm with local testing - only saving grace is it only affects a few of the more rarely used wrap modes, and I can confirm all others are unaffected. I'll try to get a fix released soon!

@timothycrosley
Copy link
Member

This is fixed in develop and will be released in the next version of isort, thanks again for reporting!

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