mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-26 11:59:10 +00:00
Fix formatter with-statement after-as own line comment instability (#6033)
**Summary** Fix an instability in with statement formatter when there is an own line comment as the `as` ```python with ( a as # bad comment b): ``` **Test Plan** Added the comment to the test cases.
This commit is contained in:
parent
a9f535997d
commit
7f3797185c
4 changed files with 44 additions and 11 deletions
|
@ -25,6 +25,7 @@ with (
|
|||
with (
|
||||
a # a
|
||||
as # as
|
||||
# own line
|
||||
b # b
|
||||
, # comma
|
||||
c # c
|
||||
|
@ -32,6 +33,13 @@ with (
|
|||
... # body
|
||||
# body trailing own
|
||||
|
||||
with (
|
||||
a # a
|
||||
as # as
|
||||
# own line
|
||||
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb # b
|
||||
): pass
|
||||
|
||||
|
||||
with (a,): # magic trailing comma
|
||||
...
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue