mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-28 12:55:05 +00:00
Enable tupleassign
test (#3080)
This commit is contained in:
parent
b701cca779
commit
90c04b9cff
4 changed files with 12 additions and 9 deletions
|
@ -134,6 +134,8 @@ fn format_tuple(
|
|||
.trivia
|
||||
.iter()
|
||||
.any(|c| matches!(c.kind, TriviaKind::MagicTrailingComma));
|
||||
let is_unbroken =
|
||||
expr.location.row() == expr.end_location.unwrap().row();
|
||||
if magic_trailing_comma {
|
||||
write!(f, [expand_parent()])?;
|
||||
}
|
||||
|
@ -143,7 +145,7 @@ fn format_tuple(
|
|||
write!(f, [text(",")])?;
|
||||
write!(f, [soft_line_break_or_space()])?;
|
||||
} else {
|
||||
if magic_trailing_comma {
|
||||
if magic_trailing_comma || is_unbroken {
|
||||
write!(f, [if_group_breaks(&text(","))])?;
|
||||
}
|
||||
}
|
||||
|
@ -156,6 +158,7 @@ fn format_tuple(
|
|||
.trivia
|
||||
.iter()
|
||||
.any(|c| matches!(c.kind, TriviaKind::MagicTrailingComma));
|
||||
let is_unbroken = expr.location.row() == expr.end_location.unwrap().row();
|
||||
if magic_trailing_comma {
|
||||
write!(f, [expand_parent()])?;
|
||||
}
|
||||
|
@ -165,7 +168,7 @@ fn format_tuple(
|
|||
write!(f, [text(",")])?;
|
||||
write!(f, [soft_line_break_or_space()])?;
|
||||
} else {
|
||||
if magic_trailing_comma {
|
||||
if magic_trailing_comma || is_unbroken {
|
||||
write!(f, [if_group_breaks(&text(","))])?;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue