mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-17 00:50:33 +00:00
Format Function definitions (#4951)
This commit is contained in:
parent
07cc4bcb0f
commit
68969240c5
79 changed files with 2601 additions and 1223 deletions
|
@ -1,3 +1,4 @@
|
|||
use crate::comments::Comments;
|
||||
use crate::expression::parentheses::{
|
||||
default_expression_needs_parentheses, NeedsParentheses, Parentheses, Parenthesize,
|
||||
};
|
||||
|
@ -15,8 +16,13 @@ impl FormatNodeRule<ExprTuple> for FormatExprTuple {
|
|||
}
|
||||
|
||||
impl NeedsParentheses for ExprTuple {
|
||||
fn needs_parentheses(&self, parenthesize: Parenthesize, source: &str) -> Parentheses {
|
||||
match default_expression_needs_parentheses(self.into(), parenthesize, source) {
|
||||
fn needs_parentheses(
|
||||
&self,
|
||||
parenthesize: Parenthesize,
|
||||
source: &str,
|
||||
comments: &Comments,
|
||||
) -> Parentheses {
|
||||
match default_expression_needs_parentheses(self.into(), parenthesize, source, comments) {
|
||||
Parentheses::Optional => Parentheses::Never,
|
||||
parentheses => parentheses,
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue