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

force_sort_within_sections with multi-line file docstring causes comments to be duplicated? #1328

Closed
EricCousineau-TRI opened this issue Jul 19, 2020 · 3 comments
Labels
bug Something isn't working

Comments

@EricCousineau-TRI
Copy link

In RobotLocomotion/drake#13709 (review), I noticed that a comment was getting duplicated.

Managed to get a min repro here, using isort==5.1.2:
https://github.com/EricCousineau-TRI/repro/blob/e73591778217dff2937db6eae5155e5574d184c0/bug/isort_bug/code.py

Basically, the following source code:

"""
Multi-line docstring
"""
# Comment for A.
import a
# Comment for B - not A!
import b

gets transformed into this:

"""
Multi-line docstring
"""
# Comment for B - not A!
import a
# Comment for B - not A!
import b

(see the linked code.py for comparison)

@timothycrosley
Copy link
Member

Thanks for reporting! This is fixed in the 5.1.3 patch release

@EricCousineau-TRI
Copy link
Author

Sweet! Thanks for the speedy response!

(Just an xref: bf47b31)

@EricCousineau-TRI
Copy link
Author

BTW I'm guessin' ya may already know, but here're GitHub's "magic words" for auto-closing issues via PRs or commits:
https://docs.github.com/en/github/managing-your-work-on-github/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword

I think this would've been auto-closed if you removed the intermediate "issue", e.g. "Fixed #1328: ..."

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