You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is sorting the import x imports seperately from the from x import y imports. Additionally, within the from imports, it is sorting based only on the line length of the module, not the entire line length. I tried setting force-sort-within-sections=true but this seems to override the length-sort and sort alphabetically as seen below.
To take this one step further, my actual ideal sort order would support some 'overriding rules' such as keeping imports from the same package together, and having imports that span multiple lines at the bottom. I don't know how complicated this would be to implement but it would be great if we could have sorting rules and order them based on priority. Something such as:
I could create a custom section for all the nnunet imports to keep them grouped together, but the other problems remain. Is there a way for me to get the expected or desired behaviour, if not would this be a hard feature to add?
The text was updated successfully, but these errors were encountered:
Not sure if this issue should be raised with isort or ruff, but since ruff is what I'm using raising it here. With the following ruff.toml file
ruff sorts my imports as follows
It is sorting the
import x
imports seperately from thefrom x import y
imports. Additionally, within thefrom
imports, it is sorting based only on the line length of the module, not the entire line length. I triedsetting force-sort-within-sections=true
but this seems to override the length-sort and sort alphabetically as seen below.My expected output for
length-sort=true
andforce-sort-within-sections=true
would beTo take this one step further, my actual ideal sort order would support some 'overriding rules' such as keeping imports from the same package together, and having imports that span multiple lines at the bottom. I don't know how complicated this would be to implement but it would be great if we could have sorting rules and order them based on priority. Something such as:
I could create a custom section for all the nnunet imports to keep them grouped together, but the other problems remain. Is there a way for me to get the expected or desired behaviour, if not would this be a hard feature to add?
The text was updated successfully, but these errors were encountered: