mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-26 20:09:22 +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
|
@ -37,10 +37,11 @@ impl FormatNodeRule<ModModule> for FormatModModule {
|
|||
|
||||
fn fmt_dangling_comments(
|
||||
&self,
|
||||
_dangling_comments: &[SourceComment],
|
||||
dangling_comments: &[SourceComment],
|
||||
_f: &mut PyFormatter,
|
||||
) -> FormatResult<()> {
|
||||
// Handled as part of `fmt_fields`
|
||||
// Node can't have dangling comments.
|
||||
debug_assert!(dangling_comments.is_empty());
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue