-
-
Notifications
You must be signed in to change notification settings - Fork 60
feat: migrate from black,isort,flake8 to ruff #7629
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
base: master
Are you sure you want to change the base?
Conversation
047aef7 to
95711b4
Compare
d3fb441 to
96adace
Compare
| "E302", # expected 2 blank lines, found N | ||
| "E501", # line too long (handled by formatter) | ||
| "E402", # module level import not at top of file | ||
| "E712", # comparison to True/False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why ignore those ones? Especially E266, E302 or E712? Is it to match current behavior?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes all the ignores are to match the previous configuration. But I would support getting rid of any ignores, and re-adding if we need it in the future.
This PR replaces black(formatting), isort(import formatting), flake8 (linter) with ruff which is faster and does all 3 in one, it is the new industry standard.
This PR migrates to ruff and reformats+lints the entire codebase with it. Its a large diff but we should just be able to rollback if things break.
You can see this commit for the main changes that actually migrate to ruff 65852d3 the rest of the diff is just from running the formatter
ruff formatthere was a single linting change made to this file, but it is logically equivalent since it was duplicate keysflake8-bugbear adds additional linting on top of flake8, our previous flake8 config enabled this but we didnt have flake8-bugbear installed in our dependencies so it wasnt actually being run. For now I disable bugbear, as a follow up I will enable it for new changes.