mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-04 02:38:25 +00:00
Implement FormatPatternMatchValue
(#6799)
## Summary This is effectively #6608, but with additional tests. We aren't properly handling parenthesized patterns, but that needs to be dealt with separately as it's somewhat involved. Closes #6555
This commit is contained in:
parent
4bdd99f882
commit
71c25e4f9d
10 changed files with 189 additions and 407 deletions
|
@ -236,3 +236,30 @@ match foo:
|
|||
"b",
|
||||
]:
|
||||
pass
|
||||
|
||||
|
||||
match foo:
|
||||
case 1:
|
||||
y = 0
|
||||
case (1):
|
||||
y = 1
|
||||
case (("a")):
|
||||
y = 1
|
||||
case ( # comment
|
||||
1
|
||||
):
|
||||
y = 1
|
||||
case (
|
||||
# comment
|
||||
1
|
||||
):
|
||||
y = 1
|
||||
case (
|
||||
1 # comment
|
||||
):
|
||||
y = 1
|
||||
case (
|
||||
1
|
||||
# comment
|
||||
):
|
||||
y = 1
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue