Fix unstable formatting of trailing end-of-line comments of parenthesized attribute values (#16187)

This commit is contained in:
Micha Reiser 2025-02-18 07:43:51 +00:00 committed by GitHub
parent 82eae511ca
commit 31180a84e4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 93 additions and 13 deletions

View file

@ -152,3 +152,20 @@ result = (
f(111111111111111111111111111111111111111111111111111111111111111111111111111111111)
+ 1
).bit_length()
# Regression test for https://github.com/astral-sh/ruff/issues/16151
result = (
(await query_the_thing(mypy_doesnt_understand)) # type: ignore[x]
.foo()
.bar()
)
(
(
a # trailing end-of-line
# trailing own-line
) # trailing closing parentheses
# dangling before dot
.b # trailing end-of-line
)