Current isort config vs ruff #2003
Closed
martinhoyer
started this conversation in
General
Replies: 2 comments
-
One import per line for long lists sounds perfectly fine. This will make patches adding one module to the import a bit more clear, as now rewrapping is a bit confusing. |
Beta Was this translation helpful? Give feedback.
0 replies
-
The isort->ruff move is being done in #2014. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
With ruff being used now, I'd like to start a discussion about potentially dropping the isort package from pre-commit and rely on ruff's import sorting.
Advantages:
A few caveats though..
Currently, we cannot emulate the default isort config as it's being used in tmt:
0 - Grid
by default, while ruff is equal to3 - Vertical Hanging Indent
. Isort also doesn't do trailing commas by default, but that's beside the point.In practice it looks like:
vs
my subjective opinion is that Hanging is more readable, but I'm no authority on the matter.
If I leave default ruff settings and only add 'known-first-party' settings, so the
from tmt.
imports are sorted as they are now, the diff would looks like this:main...martinhoyer:tmt:ruff_isort
What do you think?
Beta Was this translation helpful? Give feedback.
All reactions