Avoid line break before for in comprehension if outer expression expands (#5912)

This commit is contained in:
Micha Reiser 2023-07-20 12:07:22 +02:00 committed by GitHub
parent c2b7b46717
commit eeb8a5fe0a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 107 additions and 12 deletions

View file

@ -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)
),
)),
"}"
)]
)

View file

@ -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)
),
]),
"]"
)]
)

View file

@ -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)
),
)),
"}"
)]
)