mirror of
https://github.com/astral-sh/ruff.git
synced 2025-11-17 19:27:11 +00:00
modify attr needs parens when trailing comment
This commit is contained in:
parent
55143228fe
commit
2bccbfb30c
1 changed files with 5 additions and 1 deletions
|
|
@ -179,7 +179,11 @@ impl NeedsParentheses for ExprAttribute {
|
|||
context.comments().ranges(),
|
||||
context.source(),
|
||||
) {
|
||||
OptionalParentheses::Never
|
||||
if context.comments().has_trailing(self.value.as_ref()) {
|
||||
OptionalParentheses::Multiline
|
||||
} else {
|
||||
OptionalParentheses::Never
|
||||
}
|
||||
} else {
|
||||
self.value.needs_parentheses(self.into(), context)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue