Incorrect order with pycharm style
Opened this issue · 3 comments
I am running zimports --multi-imports --style pycharm --black-line-length 88
(version 0.6.0)
getting:
from sqlalchemy import (
Column,
DateTime,
func,
insert,
Integer,
MetaData,
select,
String,
)
expected:
from sqlalchemy import (
Column,
DateTime,
Integer,
MetaData,
String,
func,
insert,
select,
)
I tried to debug a little bit and I think it goes wrong when the file gets parsed from ast
. Seems that it returns the nodes in the tree with its own order and then no sort is happening from zimports, but im not sure.
hey there -
I don't really support zimports outside of our own use cases within SQLAlchemy (though @CaselIT may or may not want to look). Otherwise the dominant tool for import sorting these days seems to be isort. I'd use it myself if it removed unused imports. if you just need straight sorting, isort seems to be much better maintained.
of course feel free to fix the issue here as well if it's possible, we certainly accept PRs
I mostly agree with mike. Feel free to create a PR but I don't think I'll take a look at supporting this use case, sorry