mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-28 04:45:01 +00:00
Use single lookup for leading, dangling, and trailing comments (#6589)
This commit is contained in:
parent
81b1176f99
commit
29c0b9f91c
39 changed files with 319 additions and 387 deletions
|
@ -1,5 +1,6 @@
|
|||
use ruff_python_ast::ExprStarred;
|
||||
|
||||
use crate::comments::SourceComment;
|
||||
use ruff_formatter::write;
|
||||
use ruff_python_ast::node::AnyNodeRef;
|
||||
|
||||
|
@ -22,9 +23,11 @@ impl FormatNodeRule<ExprStarred> for FormatExprStarred {
|
|||
write!(f, [text("*"), value.format()])
|
||||
}
|
||||
|
||||
fn fmt_dangling_comments(&self, node: &ExprStarred, f: &mut PyFormatter) -> FormatResult<()> {
|
||||
debug_assert_eq!(f.context().comments().dangling_comments(node), []);
|
||||
|
||||
fn fmt_dangling_comments(
|
||||
&self,
|
||||
_dangling_comments: &[SourceComment],
|
||||
_f: &mut PyFormatter,
|
||||
) -> FormatResult<()> {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue