mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-28 04:45:01 +00:00
Format call expressions (without call chaining) (#5341)
## Summary This formats call expressions with magic trailing comma and parentheses behaviour but without call chaining ## Test Plan Lots of new test fixtures, including some that don't work yet
This commit is contained in:
parent
50a7769d69
commit
7f6cb9dfb5
53 changed files with 1662 additions and 1853 deletions
|
@ -13,10 +13,11 @@ impl FormatNodeRule<Keyword> for FormatKeyword {
|
|||
arg,
|
||||
value,
|
||||
} = item;
|
||||
if let Some(argument) = arg {
|
||||
write!(f, [argument.format(), text("=")])?;
|
||||
if let Some(arg) = arg {
|
||||
write!(f, [arg.format(), text("="), value.format()])
|
||||
} else {
|
||||
// Comments after the stars are reassigned as trailing value comments
|
||||
write!(f, [text("**"), value.format()])
|
||||
}
|
||||
|
||||
value.format().fmt(f)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue