Skip to content

Conversation

@zefr0x
Copy link
Contributor

@zefr0x zefr0x commented May 19, 2025

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 --all to test the linting.
Fixes: #37041

@zefr0x zefr0x marked this pull request as draft May 19, 2025 06:14
@zefr0x
Copy link
Contributor Author

zefr0x commented May 19, 2025

It seems that excluding the ./components directory in Ruff's config fails in servo-tidy.
Ruff doesn't respect the exclusion rule when the file is handed explicitly.

@zefr0x
Copy link
Contributor Author

zefr0x commented May 19, 2025

The whole ./components directory was ignored in Flake8.

Should I ignore ./components/script_bindings/codegen/CodegenRust.py in servo-tidy.toml, or just fix this single linting error in it?

@mrobinson
Copy link
Member

Should I ignore ./components/script_bindings/codegen/CodegenRust.py in servo-tidy.toml, or just fix this single linting error in it?

I would ignore this now and fix the lint errors in a followup.

@zefr0x zefr0x marked this pull request as ready for review May 19, 2025 10:26
@zefr0x
Copy link
Contributor Author

zefr0x commented May 19, 2025

Should I ignore ./components/script_bindings/codegen/CodegenRust.py in servo-tidy.toml, or just fix this single linting error in it?

I would ignore this now and fix the lint errors in a followup.

So there is no problem in merging with failing CI?

@sagudev
Copy link
Member

sagudev commented May 19, 2025

Should I ignore ./components/script_bindings/codegen/CodegenRust.py in servo-tidy.toml, or just fix this single linting error in it?

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>
@zefr0x zefr0x requested a review from sagudev May 24, 2025 12:05
Copy link
Member

@sagudev sagudev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment on lines +25 to +26
# 80 character line length; the standard tidy process will enforce line length
"E501",
Copy link
Member

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]
Copy link
Member

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.

@mrobinson mrobinson added this pull request to the merge queue May 24, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks May 24, 2025
@sagudev sagudev added this pull request to the merge queue May 24, 2025
Merged via the queue into servo:main with commit 60eb7c9 May 24, 2025
22 checks passed
github-merge-queue bot pushed a commit that referenced this pull request May 26, 2025
Requires #37045 for deps and config.

Testing: No need for tests to test tests.
Fixes: #37041

---------

Signed-off-by: zefr0x <zer0-x.7ty50@aleeas.com>
@zefr0x zefr0x deleted the flake8-to-ruff branch May 26, 2025 12:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Replace flake8 with ruff

3 participants