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

Regression: Blank line after docstring removed. #1275

Closed
adamtheturtle opened this issue Jul 6, 2020 · 3 comments
Closed

Regression: Blank line after docstring removed. #1275

adamtheturtle opened this issue Jul 6, 2020 · 3 comments
Labels
bug Something isn't working

Comments

@adamtheturtle
Copy link

Thank you for the software and congratulations on a major release.

--

I have a file like the following:

"""
My docstring
"""

from b import thing
from a import other_thing

If I run isort example.py I expect this file to change to:

"""
My docstring
"""

from a import other_thing
from b import thing

However, it changes to:

"""
My docstring
"""
from a import other_thing
from b import thing

with isort 5.0.3.

This works as expected with isort 4.3.21.

--

Also, the newline is not removed when isort does not make sorting changes, so this leaves my codebase inconsistent.

@timothycrosley timothycrosley added the bug Something isn't working label Jul 7, 2020
@adamtheturtle
Copy link
Author

@timothycrosley What a pleasant surprise to see that you have fixed this so quickly 🙏

@timothycrosley
Copy link
Member

Thank you for reporting!
I'm sorry this issue affected you! A fix has been released with version 5.0.5 of isort.

Thanks!

~Timothy

@bbugyi200
Copy link

bbugyi200 commented Jul 11, 2020

@timothycrosley This is still an issue when the --add-imports option is used. To replicate:

isort -a 'from foo import bar' example.py

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.

3 participants