mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-27 04:19:18 +00:00
Handle right parens in join comma builder (#5711)
This commit is contained in:
parent
f0aa6bd4d3
commit
653429bef9
11 changed files with 159 additions and 136 deletions
|
@ -68,8 +68,11 @@ impl Format<PyFormatContext<'_>> for AnyStatementWith<'_> {
|
|||
let comments = f.context().comments().clone();
|
||||
let dangling_comments = comments.dangling_comments(self);
|
||||
|
||||
let joined_items =
|
||||
format_with(|f| f.join_comma_separated().nodes(self.items().iter()).finish());
|
||||
let joined_items = format_with(|f| {
|
||||
f.join_comma_separated(self.body().first().unwrap().start())
|
||||
.nodes(self.items().iter())
|
||||
.finish()
|
||||
});
|
||||
|
||||
if self.is_async() {
|
||||
write!(f, [text("async"), space()])?;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue