mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-29 13:25:17 +00:00
Attach dangling comments to the comprehension instead of the if
or iter
nodes (#7693)
This commit is contained in:
parent
e62e245c61
commit
e2ec42539b
13 changed files with 124 additions and 22 deletions
|
@ -146,6 +146,15 @@ impl FormatNodeRule<ExprSlice> for FormatExprSlice {
|
|||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn fmt_dangling_comments(
|
||||
&self,
|
||||
_dangling_node_comments: &[SourceComment],
|
||||
_f: &mut PyFormatter,
|
||||
) -> FormatResult<()> {
|
||||
// Handled as part of `fmt_fields`
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
/// We're in a slice, so we know there's a first colon, but with have to look into the source
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue