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 never settles on module docstring + add import #1420

Closed
MatejNikl opened this issue Aug 27, 2020 · 2 comments · Fixed by #1424
Closed

isort never settles on module docstring + add import #1420

MatejNikl opened this issue Aug 27, 2020 · 2 comments · Fixed by #1424
Labels
bug Something isn't working
Milestone

Comments

@MatejNikl
Copy link

MatejNikl commented Aug 27, 2020

I have a file.py with the following contents:

"""module docstring"""

import os

repeatedly running isort -a "import os" file.py always prints:

Fixing /path/to/file.py

while the contents of the file.py never change.

I think isort is trying to achieve the following state:

"""module docstring"""
import as

i.e. remove the blank line, as that's when it's output is empty.
isort==5.4.2

@timothycrosley timothycrosley added the bug Something isn't working label Aug 28, 2020
@timothycrosley timothycrosley added this to the 5.5.0 milestone Aug 28, 2020
timothycrosley added a commit that referenced this issue Aug 28, 2020
…k-on-add-depending-on-doc-string-position

Fix #1420: Ensure isort doesn't include new imports in comparison
@timothycrosley
Copy link
Member

@MatejNikl Thank you for reporting the issue! It has been fixed in develop and will be deployed to PyPI in the 5.5.0 release.

Thanks!

~Timothy

@timothycrosley
Copy link
Member

A fix for this issue has just been deployed to PyPI in version 5.5.0 of isort.

Thanks!

~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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants