-
-
Notifications
You must be signed in to change notification settings - Fork 32k
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?
Changes from 1 commit
65535ee
34c1850
ba8e4bf
42ce014
e36f747
ef24b96
ec80e9b
40f9b0d
d7e99f0
0488f6d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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
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 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) 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? 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 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. 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 because one of the cases has a guard, which feels like a bug. 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. I kept the wrap-to-80 commit separate ( 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. Or maybe it has to do with the name assignment to 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. Yep, it seems to be 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. Yes. It's not just class patterns, outer grouping symbols in the pattern like 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. |
||
# 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.