mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-14 15:40:20 +00:00
Inline trailing comments for type alias similar to assignments (#8941)
This commit is contained in:
parent
8088c5367a
commit
0bf0aa28ac
3 changed files with 12 additions and 3 deletions
|
@ -2,9 +2,8 @@ use ruff_formatter::write;
|
|||
use ruff_python_ast::StmtTypeAlias;
|
||||
|
||||
use crate::comments::{SourceComment, SuppressionKind};
|
||||
use crate::expression::maybe_parenthesize_expression;
|
||||
use crate::expression::parentheses::Parenthesize;
|
||||
use crate::prelude::*;
|
||||
use crate::statement::stmt_assign::FormatStatementsLastExpression;
|
||||
|
||||
#[derive(Default)]
|
||||
pub struct FormatStmtTypeAlias;
|
||||
|
@ -30,7 +29,7 @@ impl FormatNodeRule<StmtTypeAlias> for FormatStmtTypeAlias {
|
|||
space(),
|
||||
token("="),
|
||||
space(),
|
||||
maybe_parenthesize_expression(value, item, Parenthesize::IfBreaks)
|
||||
FormatStatementsLastExpression::new(value, item)
|
||||
]
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue