mirror of
https://github.com/astral-sh/ruff.git
synced 2025-11-18 11:41:21 +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.comments().ranges(),
|
||||||
context.source(),
|
context.source(),
|
||||||
) {
|
) {
|
||||||
|
if context.comments().has_trailing(self.value.as_ref()) {
|
||||||
|
OptionalParentheses::Multiline
|
||||||
|
} else {
|
||||||
OptionalParentheses::Never
|
OptionalParentheses::Never
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
self.value.needs_parentheses(self.into(), context)
|
self.value.needs_parentheses(self.into(), context)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue