Use isort
instead of flake8-import-order
#12
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 toblack
. It also doesn't come with a first-partyflake8
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 forisort
style compliance as part of theflake8
linting step in CI (usingflake8-isort
), we also now have apre-commit
hook that will run on commited files, and anox
session for running on all relevant files at once. Theisort
style is also a little different than we were previously using withflake8-import-order
, so many files have changed.This pull request:
flake8-import-order
and associated configurationisort
and the associatedflake8-isort
pluginpre-commit
to automatically runisort
on committed filesnox
session for runningisort
isort
style