mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-29 21:35:58 +00:00
Introduce Token element (#7048)
This commit is contained in:
parent
2f3a950f6f
commit
c05e4628b1
78 changed files with 733 additions and 723 deletions
|
@ -30,7 +30,7 @@ impl FormatNodeRule<StmtIf> for FormatStmtIf {
|
|||
ClauseHeader::If(item),
|
||||
trailing_colon_comment,
|
||||
&format_args![
|
||||
text("if"),
|
||||
token("if"),
|
||||
space(),
|
||||
maybe_parenthesize_expression(test, item, Parenthesize::IfBreaks),
|
||||
],
|
||||
|
@ -86,13 +86,13 @@ pub(crate) fn format_elif_else_clause(
|
|||
write!(
|
||||
f,
|
||||
[
|
||||
text("elif"),
|
||||
token("elif"),
|
||||
space(),
|
||||
maybe_parenthesize_expression(test, item, Parenthesize::IfBreaks),
|
||||
]
|
||||
)
|
||||
} else {
|
||||
text("else").fmt(f)
|
||||
token("else").fmt(f)
|
||||
}
|
||||
}),
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue