mirror of
https://github.com/astral-sh/ruff.git
synced 2025-07-23 04:55:09 +00:00
Avoid line break before for
in comprehension if outer expression expands (#5912)
This commit is contained in:
parent
c2b7b46717
commit
eeb8a5fe0a
10 changed files with 107 additions and 12 deletions
|
@ -31,14 +31,14 @@ impl FormatNodeRule<ExprDictComp> for FormatExprDictComp {
|
|||
f,
|
||||
[parenthesized(
|
||||
"{",
|
||||
&format_args!(
|
||||
&group(&format_args!(
|
||||
group(&key.format()),
|
||||
text(":"),
|
||||
space(),
|
||||
value.format(),
|
||||
soft_line_break_or_space(),
|
||||
group(&joined)
|
||||
),
|
||||
)),
|
||||
"}"
|
||||
)]
|
||||
)
|
||||
|
|
|
@ -28,11 +28,11 @@ impl FormatNodeRule<ExprListComp> for FormatExprListComp {
|
|||
f,
|
||||
[parenthesized(
|
||||
"[",
|
||||
&format_args!(
|
||||
&group(&format_args![
|
||||
group(&elt.format()),
|
||||
soft_line_break_or_space(),
|
||||
group(&joined)
|
||||
),
|
||||
]),
|
||||
"]"
|
||||
)]
|
||||
)
|
||||
|
|
|
@ -28,11 +28,11 @@ impl FormatNodeRule<ExprSetComp> for FormatExprSetComp {
|
|||
f,
|
||||
[parenthesized(
|
||||
"{",
|
||||
&format_args!(
|
||||
&group(&format_args!(
|
||||
group(&elt.format()),
|
||||
soft_line_break_or_space(),
|
||||
group(&joined)
|
||||
),
|
||||
)),
|
||||
"}"
|
||||
)]
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue