Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Lint: Use Ruff to formatTools/jit#133123

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
AA-Turner wants to merge10 commits intopython:main
base:main
Choose a base branch
Loading
fromAA-Turner:ruff-format

Conversation

AA-Turner
Copy link
Member

It doesn't make that much sense to use two linters in our source tree. This switchesTools/jit andTools/build/check-warnings.py to use Ruff for their formatting, which has the side benefit of slightly speeding uppre-commit and the lint CI job.

A

Copy link
Member

@AlexWaygoodAlexWaygood left a comment

Choose a reason for hiding this comment

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

Seems fine to me, but please get sign-off from the people maintaining these directories (I am not!)

Comment on lines +237 to +245
case (
Hole(
offset=offset,
kind="IMAGE_REL_AMD64_REL32",
value=HoleValue.GOT,
symbol="_JIT_CONTINUE",
addend=-4,
) as hole
):
Copy link
Member

Choose a reason for hiding this comment

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

Thesecase rewrites are... odd. I don't see how it's better in any way. Is there a setting of some sort that's causing this? Maybe because one case has a guard... but that doesn't seem like a good enough reason to indent every case and wrap them in parens.

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

This case (237-245) doesn't have an if-guard, though. Are all cases put in brackets if any have a guard?

Copy link
Member

Choose a reason for hiding this comment

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

in that case it might just be due to the line length being shorter than it was previously? Addressing#133123 (review) might fix it

Copy link
Member

@brandtbucherbrandtbucherMay 2, 2025
edited
Loading

Choose a reason for hiding this comment

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

I’m not sure that’s the issue. This uses more horizontal space than not wrapping in parens, due to the additional indent.

I suspect it is becauseone of the cases has a guard, which feels like a bug.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

I kept the wrap-to-80 commit separate (42ce014 (#133123)), and the change was before that.

AlexWaygood reacted with thumbs up emoji
Copy link
Member

Choose a reason for hiding this comment

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

Or maybe it has to do with the name assignment tohole?

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Yep, it seems to beas hole that triggers the brackets. That does seem like a bug?

Copy link
Member

@brandtbucherbrandtbucherMay 2, 2025
edited
Loading

Choose a reason for hiding this comment

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

Yes. It's not just class patterns, outer grouping symbols in the pattern like(),[], and{} aren't being used effectively. See this playground, where I have my expected formatting going in and the buggy formatting coming out:https://play.ruff.rs/81f62f2d-6858-43eb-8a9b-67dcebdc56f6?secondary=Format

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member

@brandtbucherbrandtbucher left a comment

Choose a reason for hiding this comment

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

I'm okay with usingruff, but can you put the line limit back toblack's default (I think 88?). A lot of this PR is just line-wrapping churn that sort of hurts readability.

@brandtbucher
Copy link
Member

I'd like to wait on this change until the Ruff issue is fixed.

AA-Turner reacted with thumbs up emoji

@AA-Turner
Copy link
MemberAuthor

I'd like to wait on this change until the Ruff issue is fixed.

Happy to, I'll split out the non-JIT changes from this PR.

A

@AA-TurnerAA-Turner changed the titleLint: Use Ruff for all formatting in pre-commitLint: Use Ruff to formatTools/jitMay 2, 2025
@AA-TurnerAA-Turner marked this pull request as draftMay 2, 2025 21:50
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@brandtbucherbrandtbucherbrandtbucher left review comments

@AlexWaygoodAlexWaygoodAlexWaygood approved these changes

@savannahostrowskisavannahostrowskiAwaiting requested review from savannahostrowskisavannahostrowski is a code owner

@hugovkhugovkAwaiting requested review from hugovkhugovk is a code owner

Assignees
No one assigned
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@AA-Turner@brandtbucher@AlexWaygood

[8]ページ先頭

©2009-2025 Movatter.jp