mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-22 11:24:35 +00:00
Update TupleParentheses
usage (#5810)
This commit is contained in:
parent
8a7dcb794b
commit
8eadacda33
7 changed files with 88 additions and 30 deletions
|
@ -9,7 +9,6 @@ use ruff_python_ast::visitor::preorder::{walk_expr, PreorderVisitor};
|
|||
|
||||
use crate::builders::parenthesize_if_expands;
|
||||
use crate::context::NodeLevel;
|
||||
use crate::expression::expr_tuple::TupleParentheses;
|
||||
use crate::expression::parentheses::{
|
||||
is_expression_parenthesized, optional_parentheses, parenthesized, NeedsParentheses,
|
||||
OptionalParentheses, Parentheses, Parenthesize,
|
||||
|
@ -91,10 +90,7 @@ impl FormatRule<Expr, PyFormatContext<'_>> for FormatExpr {
|
|||
Expr::Starred(expr) => expr.format().fmt(f),
|
||||
Expr::Name(expr) => expr.format().fmt(f),
|
||||
Expr::List(expr) => expr.format().fmt(f),
|
||||
Expr::Tuple(expr) => expr
|
||||
.format()
|
||||
.with_options(TupleParentheses::Expr(parentheses))
|
||||
.fmt(f),
|
||||
Expr::Tuple(expr) => expr.format().fmt(f),
|
||||
Expr::Slice(expr) => expr.format().fmt(f),
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue