Experiment: add Isort to our toolchain#1872
Merged
Merged
Conversation
Replaced by flake8-isort now that we use ISort
onerandomusername
suggested changes
Oct 14, 2021
3c885a1 to
6f6e192
Compare
jchristgit
approved these changes
Oct 16, 2021
Contributor
jchristgit
left a comment
There was a problem hiding this comment.
I like this.
"some bash madness to only check the license of our prod deps"
why's that though? Does it break on isort?
Numerlor
reviewed
Oct 16, 2021
Comment on lines
+76
to
+82
| [tool.isort] | ||
| multi_line_output = 6 | ||
| order_by_type = false | ||
| case_sensitive = true | ||
| combine_as_imports = true | ||
| line_length = 120 | ||
| atomic = true |
Contributor
There was a problem hiding this comment.
Suggested change
| [tool.isort] | |
| multi_line_output = 6 | |
| order_by_type = false | |
| case_sensitive = true | |
| combine_as_imports = true | |
| line_length = 120 | |
| atomic = true | |
| [tool.isort] | |
| multi_line_output = 6 | |
| order_by_type = false | |
| case_sensitive = true | |
| combine_as_imports = true | |
| line_length = 120 | |
| atomic = true | |
| known_first_party = ["bot"] |
We should set the bot package as known first party so isort doesn't treat it as a dep
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What is Isort?
PyCQA/ISORT is a fantastic hyper configurable tool that will magically sort your imports so you don't have to care about them.
It also comes with a precommit hook. Quite an awesome tool in my opinion.
What is this PR?
This is an experiment PR, we may want to merge it, we may not want to. I set up Isort with a style that matches our current one as much as possible, and generated a quite minimal diff (f9e9dca). If we do pursue this, we may want to look at other style options (I am thinking in particular sorting by types: having the constants first, then classes and then function) that will generate larger diffs, but at least aren't a breaking code change.
This PR includes:
flake8-isort)flake8-import-order)