-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Parenthesize breaking named expressions in match guards #9396
Conversation
crates/ruff_python_formatter/tests/snapshots/format@statement__match.py.snap
Outdated
Show resolved
Hide resolved
crates/ruff_python_formatter/tests/snapshots/format@statement__match.py.snap
Show resolved
Hide resolved
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel the same as you. Maybe parenthesze is mainly intended to use for top level expressions, not for nested sub expressions.
I haven't looked at the issue (on my phone) but this is probably something that needs solving in the case formatting or we should use in_parentheses_only_softline_break in the if expression formatting
Let me try |
f564661
to
60d72a1
Compare
Ok this now looks right... |
Nice! |
Thank you |
Co-authored-by: Micha Reiser <[email protected]>
Summary
This is an attempt to solve #9394 by avoiding breaks in named expressions when invalid.