-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
use ruff rather than flake8 for python code linting #37045
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
Conversation
|
It seems that excluding the |
|
The whole Should I ignore |
I would ignore this now and fix the lint errors in a followup. |
So there is no problem in merging with failing CI? |
I think @mrobinson meant that we should make ruff less strict or exclude more files. CI must pass or else this PR cannot land. |
The initially used config is compatible with flake8 rules, including all pycodestyle (pep8) and pyflakes rules. Signed-off-by: zefr0x <zer0-x.7ty50@aleeas.com>
sagudev
left a comment
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.
LGTM
| # 80 character line length; the standard tidy process will enforce line length | ||
| "E501", |
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.
though: In the future we should enforce line limit using native tools and keep servo-tidy only for rest.
| output = "" | ||
| def check_ruff_lints(): | ||
| try: | ||
| args = ["flake8", file_name] |
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.
though: This currently does not enforce formatting, but we did not really have formating before, but we should enable it as a follow up.
The initially used config is compatible with flake8 rules, including all pycodestyle (pep8) and pyflakes rules.
Testing: Broke some python files and used
mach test-tidy --allto test the linting.Fixes: #37041