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

Allow multi-imports for typing #11

Open
bhrutledge opened this issue Feb 11, 2020 · 2 comments
Open

Allow multi-imports for typing #11

bhrutledge opened this issue Feb 11, 2020 · 2 comments

Comments

@bhrutledge
Copy link

Per the Google Style Guide, an exception to the "one import per line" rule is allowed for the typing module. Currently, it looks like the only way to accomplish this is with --multi-imports, which affects all imports.

IE, instead of:

from typing import Dict
from typing import IO
from typing import Optional
from typing import Sequence
from typing import Tuple
from typing import Union

Format as:

from typing import Dict, IO, Optional, Union, Sequence, Tuple
@zzzeek
Copy link
Contributor

zzzeek commented Feb 11, 2020

hi there -

the multi-imports feature has several issues that prevent it from working properly and there are pending pull requests at #7 and #9. I've requested corrections on both and the contributors have not responded.

I will gladly accept new PRs for this additional behavior provided you can follow up on requests to modify it but I also need help with #7 and #9.

From my POV, I wrote zimports for the use within SQLAlchemy and related projects where we do not use any kind of multi-imports as they create merge artifacts. I'm not really sure why other people don't have this issue, but in any case multi-imports is a feature that other people would have to contribute.

@zzzeek
Copy link
Contributor

zzzeek commented Feb 11, 2020

specifically, you're really going to need #9 for your change above to work correctly otherwise you'll have too-long lines generated.

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

2 participants