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
A style I adopted long ago (from Guido IIRC) was to sort the regular imports by length first then alphabetical, while sorting from...imports alphabetically only. E.g.
import os
import sys
import datetime
from contextlib import ExitStack
from datetime import timedelta
However this doesn't seem possible, since length_sort is a single configuration for both sections. If I set length_sort = false I get:
# These are sorted in the wrong order.
import datetime
import os
import sys
# These are sorted correctly.
from contextlib import ExitStack
from datetime import timedelta
and if I set length_sort = true I get:
# These are sorted correctly.
import os
import sys
import datetime
# These are sorted in the wrong order.
from datetime import timedelta
from contextlib import ExitStack
Neither of which I actually want. Can you add a setting to split regular import sorting from from...import sorting?
Thanks for a great tool!
The text was updated successfully, but these errors were encountered:
I'm def open to supporting this! Will have to be post 5.0.0 as I'm pretty heads down getting that out the door. Then I'll revisit. Thanks for the suggestion!
A style I adopted long ago (from Guido IIRC) was to sort the regular imports by length first then alphabetical, while sorting from...imports alphabetically only. E.g.
However this doesn't seem possible, since
length_sort
is a single configuration for both sections. If I setlength_sort = false
I get:and if I set
length_sort = true
I get:Neither of which I actually want. Can you add a setting to split regular import sorting from from...import sorting?
Thanks for a great tool!
The text was updated successfully, but these errors were encountered: