mirror of
https://github.com/astral-sh/ruff
synced 2026-01-22 14:00:51 -05:00
Fix inconsistent expr_lambda formatting (#6318)
This commit is contained in:
@@ -43,6 +43,11 @@ impl FormatNodeRule<ExprLambda> for FormatExprLambda {
|
||||
write!(f, [dangling_comments(dangling)])?;
|
||||
}
|
||||
|
||||
// Insert hard line break if body has leading comment to ensure consistent formatting
|
||||
if comments.has_leading(body.as_ref()) {
|
||||
write!(f, [hard_line_break()])?;
|
||||
}
|
||||
|
||||
write!(f, [body.format()])
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user