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 sorts imports even if they were not edited #72

Closed
akaihola opened this issue Sep 2, 2020 · 0 comments · Fixed by #238
Closed

--isort sorts imports even if they were not edited #72

akaihola opened this issue Sep 2, 2020 · 0 comments · Fixed by #238
Labels
enhancement New feature or request
Milestone

Comments

@akaihola
Copy link
Owner

akaihola commented Sep 2, 2020

The problem with applying isort modifications "surgically" is in the fact that isort may (and often does) change the order of lines.

Could we consider all changes by isort as one contiguous diff chunk, and apply it if any line in edited_linenums falls inside that chunk? Is there an edge case where isort only modifies part of the import lines, and a user edit happens to an import outside that part? I can't see a problem there. The important thing is that either all or none of the isort modifications are applied.

@akaihola akaihola added the enhancement New feature or request label Sep 2, 2020
@akaihola akaihola added this to the 1.4.0 milestone Sep 4, 2021
@akaihola akaihola modified the milestones: 1.4.0, 1.4.1, 1.5.0 Feb 8, 2022
@akaihola akaihola changed the title Apply import sorting (by isort) only if imports were edited --isort sorts imports even if they were not edited Apr 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant