mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-31 15:48:22 +00:00
Preserve parentheses around partial call chains (#7109)
This commit is contained in:
parent
7be28a38c5
commit
ece30e7c69
4 changed files with 207 additions and 38 deletions
|
@ -167,6 +167,61 @@ max_message_id = (
|
|||
max_message_id = (
|
||||
Message.objects.filter(recipient=recipient).order_by("id").reverse()[0].id()
|
||||
)
|
||||
|
||||
# Parentheses with fluent style within and outside of the parentheses.
|
||||
(
|
||||
(
|
||||
df1_aaaaaaaaaaaa.merge()
|
||||
)
|
||||
.groupby(1,)
|
||||
.sum()
|
||||
)
|
||||
|
||||
(
|
||||
( # foo
|
||||
df1_aaaaaaaaaaaa.merge()
|
||||
)
|
||||
.groupby(1,)
|
||||
.sum()
|
||||
)
|
||||
|
||||
(
|
||||
(
|
||||
df1_aaaaaaaaaaaa.merge()
|
||||
.groupby(1,)
|
||||
)
|
||||
.sum()
|
||||
)
|
||||
|
||||
|
||||
(
|
||||
(
|
||||
df1_aaaaaaaaaaaa.merge()
|
||||
.groupby(1,)
|
||||
)
|
||||
.sum()
|
||||
.bar()
|
||||
)
|
||||
|
||||
(
|
||||
(
|
||||
df1_aaaaaaaaaaaa.merge()
|
||||
.groupby(1,)
|
||||
.bar()
|
||||
)
|
||||
.sum()
|
||||
)
|
||||
|
||||
(
|
||||
(
|
||||
df1_aaaaaaaaaaaa.merge()
|
||||
.groupby(1,)
|
||||
.bar()
|
||||
)
|
||||
.sum()
|
||||
.baz()
|
||||
)
|
||||
|
||||
```
|
||||
|
||||
## Output
|
||||
|
@ -350,6 +405,66 @@ max_message_id = (
|
|||
max_message_id = (
|
||||
Message.objects.filter(recipient=recipient).order_by("id").reverse()[0].id()
|
||||
)
|
||||
|
||||
# Parentheses with fluent style within and outside of the parentheses.
|
||||
(
|
||||
(df1_aaaaaaaaaaaa.merge())
|
||||
.groupby(
|
||||
1,
|
||||
)
|
||||
.sum()
|
||||
)
|
||||
|
||||
(
|
||||
( # foo
|
||||
df1_aaaaaaaaaaaa.merge()
|
||||
)
|
||||
.groupby(
|
||||
1,
|
||||
)
|
||||
.sum()
|
||||
)
|
||||
|
||||
(
|
||||
(
|
||||
df1_aaaaaaaaaaaa.merge().groupby(
|
||||
1,
|
||||
)
|
||||
).sum()
|
||||
)
|
||||
|
||||
|
||||
(
|
||||
(
|
||||
df1_aaaaaaaaaaaa.merge().groupby(
|
||||
1,
|
||||
)
|
||||
)
|
||||
.sum()
|
||||
.bar()
|
||||
)
|
||||
|
||||
(
|
||||
(
|
||||
df1_aaaaaaaaaaaa.merge()
|
||||
.groupby(
|
||||
1,
|
||||
)
|
||||
.bar()
|
||||
).sum()
|
||||
)
|
||||
|
||||
(
|
||||
(
|
||||
df1_aaaaaaaaaaaa.merge()
|
||||
.groupby(
|
||||
1,
|
||||
)
|
||||
.bar()
|
||||
)
|
||||
.sum()
|
||||
.baz()
|
||||
)
|
||||
```
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue