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

Formatting: reorder python imports #346

Merged
merged 2 commits into from
Jul 24, 2019

Conversation

Glutexo
Copy link
Collaborator

@Glutexo Glutexo commented Jul 12, 2019

Added the reorder-python-imports package to the development dependencies. Used it to reorder imports in all Python files.

find . -type f -name '*.py' | xargs -L1 reorder-python-imports

The tool has split the imports into three groups, ordered them alphabetically and split multiple imports into separate lines. This will be later done automatically by a pre-commit hook. #331

This is a part of the way to having the code cleanly formatted. #189

@Glutexo Glutexo self-assigned this Jul 12, 2019
@Glutexo
Copy link
Collaborator Author

Glutexo commented Jul 15, 2019

This has been approved. Merge, @dehort, @lphiri?

@Glutexo Glutexo force-pushed the reorder_python_imports branch from 564c295 to 5dcd020 Compare July 17, 2019 09:34
@Glutexo
Copy link
Collaborator Author

Glutexo commented Jul 17, 2019

Mergeable again. Essentially did it from ground up. Pipfile.lock had conflicts and running the script again is simpler than manually resolving conflicts. So maybe it’d be worth a new review.

Added the reorder-python-imports package to the development
dependencies.
@Glutexo Glutexo force-pushed the reorder_python_imports branch from 5dcd020 to cf6a9eb Compare July 19, 2019 08:38
Use the reorder-python-imports tool to reorder imports in all Python
files. It separates them in three groups and splits them into multiple
lines.
@Glutexo Glutexo force-pushed the reorder_python_imports branch from cf6a9eb to edf96eb Compare July 19, 2019 08:43
@Glutexo
Copy link
Collaborator Author

Glutexo commented Jul 19, 2019

Rebased once more to fix the conflicts.

@Glutexo
Copy link
Collaborator Author

Glutexo commented Jul 24, 2019

This pull request has been approved again. Can we merge it?

@dehort dehort merged commit 6fd9740 into RedHatInsights:master Jul 24, 2019
@Glutexo Glutexo deleted the reorder_python_imports branch July 25, 2019 07:09
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.

4 participants