mirror of
https://github.com/astral-sh/ruff
synced 2026-01-08 15:14:19 -05:00
Preserve tuple parentheses in case patterns (#18147)
This commit is contained in:
@@ -288,5 +288,13 @@ match x:
|
||||
]:
|
||||
pass
|
||||
|
||||
|
||||
match a, b:
|
||||
case [], []:
|
||||
...
|
||||
case [], _:
|
||||
...
|
||||
case _, []:
|
||||
...
|
||||
case _, _:
|
||||
...
|
||||
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
# Ruff in some cases added brackets around tuples in some cases; deviating from Black.
|
||||
# Ensure we don't revert already-applied formats with the fix.
|
||||
# See https://github.com/astral-sh/ruff/pull/18147
|
||||
match a, b:
|
||||
case [[], []]:
|
||||
...
|
||||
case [[], _]:
|
||||
...
|
||||
Reference in New Issue
Block a user