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

Comments not wrapped for long lines #1219

Closed
dzieciou opened this issue May 29, 2020 · 1 comment
Closed

Comments not wrapped for long lines #1219

dzieciou opened this issue May 29, 2020 · 1 comment
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@dzieciou
Copy link
Contributor

dzieciou commented May 29, 2020

Version 4.3.21:

I have the following problematic file totest.py:

from many_stop_words import (
    get_stop_words as get_base_stopwords,
)  # extended list of stop words, also for en

I run isort, black and then check results with isort to see if imports order have been preserved. The last step simulates what happens on Jenkins:

isort  -m 3 -tc -w 105 totest.py
black --line-length 105 totest.py
isort -c -m 3 -tc -w 105 totest.py

After first step I got

from many_stop_words import get_stop_words as get_base_stopwords  # extended list of stop words, also for en

After second step, black formatting, I got

from many_stop_words import (
    get_stop_words as get_base_stopwords,
)  # extended list of stop words, also for en

After last step, the check fails:

ERROR: totest.py Imports are incorrectly sorted.

It looks like isort ignores comments when wrapping long lines. The line without comment has 64 chars but with comment it has 108 chars, exceeding requested 105 chars.

I would expected from isort -m 3 -tc -w 105 totest.py to give the following output:

from many_stop_words import (
    get_stop_words as get_base_stopwords,
)  # extended list of stop words, also for en

How can I make isort to do that?

@timothycrosley timothycrosley added bug Something isn't working help wanted Extra attention is needed labels Jul 4, 2020
@timothycrosley
Copy link
Member

Thanks for reporting! This is fixed in release 5.1.2

~Timothy

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

No branches or pull requests

2 participants