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

Option to avoid rewriting existing grid-wrap imports #2102

Open
eli-schwartz opened this issue Feb 28, 2023 · 0 comments
Open

Option to avoid rewriting existing grid-wrap imports #2102

eli-schwartz opened this issue Feb 28, 2023 · 0 comments

Comments

@eli-schwartz
Copy link
Contributor

eli-schwartz commented Feb 28, 2023

When running isort on a codebase that already has imports formatted like this:

from foobar import (
    abc, bcd, cde, dff, efg, fgh, ghi, hij, ijk,
    jkl, klm, lmn, mno, nop, opq, pqr, qrs, rst,
    stu, tuv, uvw, vwx, wxy, xyz, yza, zab,
)

And the latest commit removes the use of "abc" so the import is also removed, isort wants to "fix" my imports so it reshuffles all 3 lines. This is very noisy for commit logs, and I'd rather permit the first line to go shorter and stay that way. I'll probably eventually add another import back, and the line will grow again... I don't care if it is balanced.

I think what I probably want is that isort should apply whichever change it would otherwise apply, but only if something was actually sorted (or optionally, if the max line length was exceeded), not if the only change would be to rebalance it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant