mirror of
https://github.com/astral-sh/ruff.git
synced 2025-11-01 12:25:45 +00:00
Format PatternMatchSequence (#6676)
This commit is contained in:
parent
c34a342ab4
commit
94f5f18ddb
9 changed files with 353 additions and 143 deletions
|
|
@ -172,6 +172,7 @@ match x:
|
|||
case (a as b) as c:
|
||||
pass
|
||||
|
||||
|
||||
match pattern_singleton:
|
||||
case (
|
||||
# leading 1
|
||||
|
|
@ -187,3 +188,30 @@ match pattern_singleton:
|
|||
...
|
||||
case False:
|
||||
...
|
||||
|
||||
|
||||
match foo:
|
||||
case "a", "b":
|
||||
pass
|
||||
case "a", "b",:
|
||||
pass
|
||||
case ("a", "b"):
|
||||
pass
|
||||
case ["a", "b"]:
|
||||
pass
|
||||
case (["a", "b"]):
|
||||
pass
|
||||
|
||||
|
||||
match foo:
|
||||
case [ # leading
|
||||
# leading
|
||||
# leading
|
||||
# leading
|
||||
"a", # trailing
|
||||
# trailing
|
||||
# trailing
|
||||
# trailing
|
||||
"b",
|
||||
]:
|
||||
pass
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue