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

Question: auto formatting & sorting imports #39

Closed
h4l opened this issue Sep 9, 2022 · 5 comments · Fixed by #40
Closed

Question: auto formatting & sorting imports #39

h4l opened this issue Sep 9, 2022 · 5 comments · Fixed by #40

Comments

@h4l
Copy link
Contributor

h4l commented Sep 9, 2022

@NickCrews would you be OK with auto sorting/formatting imports (probably with isort)?

When I was rebasing the error message PR just now, and a few other branches I've got, probably 3/4 of my merge conflicts were just imports. I'm thinking it would help to use isort with the single line option, so that instead of:

from typing import Any, Callable, Tuple, Type, Union, cast

we get:

from typing import Any
from typing import Callable
from typing import Tuple
from typing import Type
from typing import Union
from typing import cast

Which doesn't look as nice, but means import changes shouldn't cause merge conflicts.

@h4l
Copy link
Contributor Author

h4l commented Sep 9, 2022

This is what it would look like: master...h4l:docopt-ng:isort

@NickCrews
Copy link
Contributor

NickCrews commented Sep 9, 2022

Yes I LOVE autoformatters such as black and I sort.

I'll just make a PR off that branch and merge?

@h4l
Copy link
Contributor Author

h4l commented Sep 9, 2022

Awesome! Yep, please do.

@NickCrews NickCrews mentioned this issue Sep 9, 2022
@NickCrews
Copy link
Contributor

I merged #37 first to avoid merge conflicts, which then made your branch have conflicts, so I just re-implemented it myself

@h4l
Copy link
Contributor Author

h4l commented Sep 10, 2022

Thanks @NickCrews, that's sensible. Good to move towards pyproject.toml too.

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

Successfully merging a pull request may close this issue.

2 participants