mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-29 06:44:42 +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
|
@ -5,6 +5,7 @@ use ruff_python_ast::{Expr, Ranged};
|
|||
use ruff_text_size::TextRange;
|
||||
|
||||
use crate::builders::parenthesize_if_expands;
|
||||
use crate::comments::SourceComment;
|
||||
use crate::expression::parentheses::{
|
||||
empty_parenthesized, parenthesized, NeedsParentheses, OptionalParentheses,
|
||||
};
|
||||
|
@ -162,7 +163,11 @@ impl FormatNodeRule<ExprTuple> for FormatExprTuple {
|
|||
}
|
||||
}
|
||||
|
||||
fn fmt_dangling_comments(&self, _node: &ExprTuple, _f: &mut PyFormatter) -> FormatResult<()> {
|
||||
fn fmt_dangling_comments(
|
||||
&self,
|
||||
_dangling_comments: &[SourceComment],
|
||||
_f: &mut PyFormatter,
|
||||
) -> FormatResult<()> {
|
||||
// Handled in `fmt_fields`
|
||||
Ok(())
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue