Migration codestyle from Flake8 to ruff#2523
Merged
Merged
Conversation
886d17f to
8d03df8
Compare
mbaruh
reviewed
Apr 10, 2023
Member
Author
|
Will squash all fixup commits before merging, so marking as do not merge so I can do that once approved. |
mbaruh
requested changes
Apr 10, 2023
Member
mbaruh
left a comment
There was a problem hiding this comment.
There are various places across the codebase where a type alias is set to some Union, which doesn't seem to be handled by the autofixes. You can find them by regex matching = (t\.|typing\.)?Union across the project.
wookie184
reviewed
Apr 11, 2023
de4c846 to
2e968ad
Compare
wookie184
requested changes
Apr 11, 2023
Co-authored-by: Boris Muratov <8bee278@gmail.com> Co-authored-by: wookie184 <wookie1840@gmail.com>
2e968ad to
bd8a9b9
Compare
This is required as | is not supported between a function and NoneType
bd8a9b9 to
2a3ed04
Compare
Contributor
|
FWIW I opened two issues on the ruff repo regarding the typing things it didn't pick up: astral-sh/ruff#3937 and astral-sh/ruff#3936. |
mbaruh
approved these changes
Apr 11, 2023
jchristgit
approved these changes
Apr 11, 2023
Contributor
|
BEAST!!!!!! |
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.
To see these code changes commit-by-commit see this diff.
This migrates our linting toolchain from flake8, and related plug-ins, to ruff. from testing, ruff is considerably faster, as well as having more auto-fix support for many of the rules.
There are also more rules than what we have enabled in this PR, which we may look into adding in the future.
See the
selectlike in pyproject.toml to see the list of rules that have been added. Specific rules have also been disabled, for not fitting into our code style, seeignorefor which rules have been ignored. A full list of ruff rules can be found here