mirror of
https://github.com/astral-sh/ruff.git
synced 2025-07-24 13:33:50 +00:00
Handle open-parenthesis comments on match case (#6798)
## Summary Ensures that we retain the open-parenthesis comment in cases like: ```python match pattern_comments: case ( # leading only_leading ): ... ``` Previously, this was treated as a leading comment on `only_leading`. ## Test Plan `cargo test`
This commit is contained in:
parent
5f5de52aba
commit
4bc5eddf91
4 changed files with 37 additions and 20 deletions
|
@ -222,8 +222,7 @@ match ( # d 2
|
|||
case d2:
|
||||
pass
|
||||
match d3:
|
||||
case (
|
||||
# d 3
|
||||
case ( # d 3
|
||||
x
|
||||
):
|
||||
pass
|
||||
|
|
|
@ -354,8 +354,7 @@ match pattern_comments:
|
|||
|
||||
|
||||
match pattern_comments:
|
||||
case (
|
||||
# leading
|
||||
case ( # leading
|
||||
only_leading
|
||||
):
|
||||
pass
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue