Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 34k
Lint: Use Ruff to format Tools/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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base:main
Are you sure you want to change the base?
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
65535ee34c1850ba8e4bf42ce014e36f747ef24b96ec80e9b40f9b0dd7e99f00488f6dFile filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| extend = "../../.ruff.toml" # Inherit the project-wide settings | ||
| line-length = 88 # slightly longer than PEP 8, for readability | ||
| [format] | ||
| preview = true | ||
| docstring-code-format = true |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -230,35 +230,41 @@ def remove_jump(self) -> None: | ||
| """Remove a zero-length continuation jump, if it exists.""" | ||
| hole = max(self.holes, key=lambda hole: hole.offset) | ||
| match hole: | ||
| case Hole( | ||
| offset=offset, | ||
| kind="IMAGE_REL_AMD64_REL32", | ||
| value=HoleValue.GOT, | ||
| symbol="_JIT_CONTINUE", | ||
| addend=-4, | ||
| ) as hole: | ||
| case ( | ||
| Hole( | ||
| offset=offset, | ||
| kind="IMAGE_REL_AMD64_REL32", | ||
| value=HoleValue.GOT, | ||
| symbol="_JIT_CONTINUE", | ||
| addend=-4, | ||
| ) as hole | ||
| ): | ||
Comment on lines +233 to +241 Member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These Member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is https://astral.sh/blog/ruff-v0.9.0#automatically-parenthesized-if-guards-in-match-case-statements (which Black doesn't do) MemberAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe 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? Member There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 Member
| ||
| # jmp qword ptr [rip] | ||
| jump = b"\x48\xff\x25\x00\x00\x00\x00" | ||
| offset -= 3 | ||
| case Hole( | ||
| offset=offset, | ||
| kind="IMAGE_REL_I386_REL32" | "R_X86_64_PLT32" | "X86_64_RELOC_BRANCH", | ||
| value=HoleValue.CONTINUE, | ||
| symbol=None, | ||
| addend=addend, | ||
| ) as hole if ( | ||
| _signed(addend) == -4 | ||
| ): | ||
| case ( | ||
| Hole( | ||
| offset=offset, | ||
| kind="IMAGE_REL_I386_REL32" | ||
| | "R_X86_64_PLT32" | ||
| | "X86_64_RELOC_BRANCH", | ||
| value=HoleValue.CONTINUE, | ||
| symbol=None, | ||
| addend=addend, | ||
| ) as hole | ||
| ) if _signed(addend) == -4: | ||
| # jmp 5 | ||
| jump = b"\xe9\x00\x00\x00\x00" | ||
| offset -= 1 | ||
| case Hole( | ||
| offset=offset, | ||
| kind="R_AARCH64_JUMP26", | ||
| value=HoleValue.CONTINUE, | ||
| symbol=None, | ||
| addend=0, | ||
| ) as hole: | ||
| case ( | ||
| Hole( | ||
| offset=offset, | ||
| kind="R_AARCH64_JUMP26", | ||
| value=HoleValue.CONTINUE, | ||
| symbol=None, | ||
| addend=0, | ||
| ) as hole | ||
| ): | ||
| # b #4 | ||
| jump = b"\x00\x00\x00\x14" | ||
| case _: | ||
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.