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

Added pre-commit hook for reorder-python-imports. #1575

Closed
wants to merge 2 commits into from
Closed

Added pre-commit hook for reorder-python-imports. #1575

wants to merge 2 commits into from

Conversation

dapperfu
Copy link

Tool for automatically reordering python imports. Similar to isort but uses static analysis more.

From https://github.com/asottile/reorder_python_imports

why this style?

The style chosen by reorder-python-imports has a single aim: reduce merge conflicts.
By having a single import per line, multiple contributors can add / remove imports from a single module without resulting in a conflict.

J and others added 2 commits May 27, 2020 15:16
Tool for automatically reordering python imports. Similar to isort but uses static analysis more.
@pd0wm
Copy link
Contributor

pd0wm commented May 27, 2020

Sorry, I'm not a fan. This PR adds a huge number of lines, and would take a significant time to review. Don't think the style is that useful, and a commit hook for this sounds overkill.

The commit-hook project sounds interesting though. I would definitely merge something that runs flake8 and pylint on the modified files!

@dapperfu
Copy link
Author

It passes all tests. It improves code quality and makes future merges easier.

@adeebshihadeh
Copy link
Contributor

I’m not a fan of the style either. It really doesn’t make merging easier. I don’t remember the last time I had a merge conflict because of import lines.

pd0wm added a commit that referenced this pull request May 28, 2020
* "The commit-hook project sounds interesting though. I would definitely merge something that runs flake8 and pylint on the modified files!"
-  pd0wm, #1575 (comment)

* add pylint to pre-commit and make everything pass

* Remove uncommented stuff

Co-authored-by: J <user@4800.lan>
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 this pull request may close these issues.

None yet

3 participants