From d24895d42492e0d237f00719954380826702a007 Mon Sep 17 00:00:00 2001 From: Brent Westbrook Date: Fri, 12 Dec 2025 10:07:18 -0500 Subject: [PATCH] comment on leading_body_comments --- crates/ruff_python_formatter/src/expression/expr_lambda.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/crates/ruff_python_formatter/src/expression/expr_lambda.rs b/crates/ruff_python_formatter/src/expression/expr_lambda.rs index c4f67d4690..b2afdeea99 100644 --- a/crates/ruff_python_formatter/src/expression/expr_lambda.rs +++ b/crates/ruff_python_formatter/src/expression/expr_lambda.rs @@ -271,6 +271,8 @@ impl Format> for FormatBody<'_> { { trailing_comments(dangling).fmt(f)?; + // Note that `leading_body_comments` have already been formatted as part of + // `dangling` above, but their presence still determines the spacing here. if leading_body_comments.is_empty() { space().fmt(f)?; } else {