mirror of https://github.com/astral-sh/ruff
comment on leading_body_comments
This commit is contained in:
parent
17a1065fad
commit
d24895d424
|
|
@ -271,6 +271,8 @@ impl Format<PyFormatContext<'_>> 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 {
|
||||
|
|
|
|||
Loading…
Reference in New Issue