-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Open
Labels
bugSomething isn't workingSomething isn't workingformatterRelated to the formatterRelated to the formatter
Description
my_object.elemnt[
0
].subelement = SomeEnumName.VERY_VERY_VERY_LONG_ENUM_VALUE_DESCeeeeeebbbdddddddddddddddddeeedddddThis is ugly 😓
Black does a better job and formats it as:
my_object.elemnt[0].subelement = (
SomeEnumName.VERY_VERY_VERY_LONG_ENUM_VALUE_DESCeeeeeebbbdddddddddddddddddeeeddddd
)Which would align with how subscripts are handled in can_omit_optional_parentheses:
ruff/crates/ruff_python_formatter/src/expression/mod.rs
Lines 611 to 612 in 0a86ffe
| !expr.is_subscript_expr() | |
| && has_parentheses(expr, context).is_some_and(OwnParentheses::is_non_empty) |
Avasam and cvdub
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingformatterRelated to the formatterRelated to the formatter