-
-
Notifications
You must be signed in to change notification settings - Fork 584
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
Bug: Isort dropping # noqa comment #1594
Comments
Just to be clear, the expected result would look like
|
@anirudnits That's right, thanks |
That seems to be a dead lock with
this is the input and also expected output: from pl_bolts.models.self_supervised.moco.transforms import Moco2EvalCIFAR10Transforms # noqa: F401
from pl_bolts.models.self_supervised.moco.transforms import ( # noqa: F401
Moco2EvalImagenetTransforms,
Moco2EvalSTL10Transforms,
...
) and this is the result: from pl_bolts.models.self_supervised.moco.transforms import Moco2EvalCIFAR10Transforms # noqa: F401; noqa: F401
from pl_bolts.models.self_supervised.moco.transforms import (
Moco2EvalImagenetTransforms,
Moco2EvalSTL10Transforms,
...
) just using |
Sorry to hear you are experiencing this issue as well! As a friendly reminder, in case you or others in this thread are unaware, while the project certainly prioritizes fixing issues like this, you should never feel stuck! isort provides many escape hatches for any disagreements with other tools, of particular good use for this issue is https://pycqa.github.io/isort/docs/configuration/action_comments/#isort-off |
@timothycrosley thanks for such swift reply and for this nice too |
This is now fixed in develop and will make its way out in the next release (5.8.0) Thanks! ~Timothy |
Version:
5.6.4
Python 3.7
Description
Isort drops # noqa comment while sorting, when two imports from the same file/module exists, and one of them exceeds the max line length.
Steps to reproduce
Create two files with content as below. Sort
test_isort.py
with isorttest.py
test_isort.py
Actual result:
As you can see, #noqa comment was dropped from the second line, resulting in linter failling.
Expected result:
Imports should be joined together, single # noqa comment exists.
The text was updated successfully, but these errors were encountered: