mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-03 18:28:24 +00:00
Parenthesize breaking named expressions in match guards (#9396)
## Summary This is an attempt to solve https://github.com/astral-sh/ruff/issues/9394 by avoiding breaks in named expressions when invalid.
This commit is contained in:
parent
b1a5df8694
commit
ba71772d93
3 changed files with 22 additions and 2 deletions
|
@ -115,6 +115,11 @@ match long_lines:
|
|||
): # another comment
|
||||
pass
|
||||
|
||||
case {
|
||||
"long_long_long_key": str(long_long_long_key)
|
||||
} if value := "long long long long long long long long long long long value":
|
||||
pass
|
||||
|
||||
|
||||
match pattern_comments:
|
||||
case (
|
||||
|
@ -696,6 +701,11 @@ match long_lines:
|
|||
): # another comment
|
||||
pass
|
||||
|
||||
case {
|
||||
"long_long_long_key": str(long_long_long_key)
|
||||
} if value := "long long long long long long long long long long long value":
|
||||
pass
|
||||
|
||||
|
||||
match pattern_comments:
|
||||
case (
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue