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

Use isort instead of flake8-import-order #12

Merged
merged 6 commits into from Mar 15, 2022
Merged

Use isort instead of flake8-import-order #12

merged 6 commits into from Mar 15, 2022

Conversation

edsq
Copy link
Owner

@edsq edsq commented Mar 15, 2022

flake8-import-order is in maintenance mode and hasn't been updated for several years.

isort is being actively developed and seems to enjoy some popularity. This is a little different from flake8-import-order, as by default it actually re-writes code to fit its style, similarly to black. It also doesn't come with a first-party flake8 plugin, so we are using flake8-isort.

The intended behavior is therefore just a little different than it was with only flake8-import-order. While we still check for isort style compliance as part of the flake8 linting step in CI (using flake8-isort), we also now have a pre-commit hook that will run on commited files, and a nox session for running on all relevant files at once. The isort style is also a little different than we were previously using with flake8-import-order, so many files have changed.

This pull request:

  • Removes flake8-import-order and associated configuration
  • Adds isort and the associated flake8-isort plugin
  • Configures pre-commit to automatically run isort on committed files
  • Adds a nox session for running isort
  • Updates all imports to be compatible with the isort style

@edsq edsq added refactoring Refactoring removal Removals or deprecations labels Mar 15, 2022
@edsq edsq merged commit c629da2 into main Mar 15, 2022
@edsq edsq deleted the use_isort branch March 15, 2022 18:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactoring Refactoring removal Removals or deprecations
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant