-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
formatter: debug panic in placement::find_pos_only_slash_offset #5176
Comments
Thanks for reporting this issue. This is a bug in my implementation. We can fix it by either: Changing the fallback from ruff/crates/ruff_python_formatter/src/comments/placement.rs Lines 640 to 642 in be11cae
Gracefully handle a ruff/crates/ruff_python_formatter/src/comments/placement.rs Lines 845 to 846 in be11cae
I would prefer the first fix because |
@davidszotten I tried to reproduce, but your provided snippet does not panic on main (although it gets formatted extremely weirdly): def foo(
a=2 # trailing
**3,
):
... |
The weird formatting should be fixed in #5204 |
panic was fixed by #5192 (rustpython upgrade) |
while working on comments inside tuple unpacking between stars and name (following #5167 (comment) )
i was wondering if function arguments could have the same issue. in trying to test that i found my test case violates this debug assert
commit: be11cae
The text was updated successfully, but these errors were encountered: