mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-19 08:40:39 +00:00
Unify comment terminology with that of rome_formatter
(#2979)
This commit is contained in:
parent
34664a0ca0
commit
180541a924
4 changed files with 64 additions and 45 deletions
|
@ -37,7 +37,7 @@ impl Format<ASTFormatContext<'_>> for LeadingComments<'_> {
|
|||
fn fmt(&self, f: &mut Formatter<ASTFormatContext<'_>>) -> FormatResult<()> {
|
||||
for comment in self.comments {
|
||||
if matches!(comment.relationship, Relationship::Leading) {
|
||||
if let TriviaKind::StandaloneComment(range) = comment.kind {
|
||||
if let TriviaKind::OwnLineComment(range) = comment.kind {
|
||||
write!(f, [hard_line_break()])?;
|
||||
write!(f, [literal(range)])?;
|
||||
}
|
||||
|
@ -61,7 +61,7 @@ impl Format<ASTFormatContext<'_>> for TrailingComments<'_> {
|
|||
fn fmt(&self, f: &mut Formatter<ASTFormatContext<'_>>) -> FormatResult<()> {
|
||||
for comment in self.comments {
|
||||
if matches!(comment.relationship, Relationship::Trailing) {
|
||||
if let TriviaKind::StandaloneComment(range) = comment.kind {
|
||||
if let TriviaKind::OwnLineComment(range) = comment.kind {
|
||||
write!(f, [hard_line_break()])?;
|
||||
write!(f, [literal(range)])?;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue