mirror of
https://github.com/astral-sh/ruff
synced 2026-01-22 14:00:51 -05:00
Use BestFit layout even for attributes with a short name (#6872)
This commit is contained in:
@@ -153,6 +153,8 @@ impl NeedsParentheses for ExprAttribute {
|
||||
OptionalParentheses::Multiline
|
||||
} else if context.comments().has_dangling(self) {
|
||||
OptionalParentheses::Always
|
||||
} else if self.value.is_name_expr() {
|
||||
OptionalParentheses::BestFit
|
||||
} else {
|
||||
self.value.needs_parentheses(self.into(), context)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user