File tree 3 files changed +22
-0
lines changed
crates/ruff_python_formatter
resources/test/fixtures/ruff/expression
3 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -65,3 +65,8 @@ def test():
65
65
66
66
m2m_also_quite_long_zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz = models .ManyToManyField (Person , blank = True )
67
67
m2m_also_quite_long_zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz = models .ManyToManyFieldAttributeChainFieeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeld
68
+
69
+ def test ():
70
+ if True :
71
+ VLM_m2m = VLM .m2m_also_quite_long_zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz .through
72
+ allows_group_by_select_index = self .connection .features .allows_group_by_select_index
Original file line number Diff line number Diff line change @@ -153,6 +153,8 @@ impl NeedsParentheses for ExprAttribute {
153
153
OptionalParentheses :: Multiline
154
154
} else if context. comments ( ) . has_dangling ( self ) {
155
155
OptionalParentheses :: Always
156
+ } else if self . value . is_name_expr ( ) {
157
+ OptionalParentheses :: BestFit
156
158
} else {
157
159
self . value . needs_parentheses ( self . into ( ) , context)
158
160
}
Original file line number Diff line number Diff line change @@ -71,6 +71,11 @@ def test():
71
71
72
72
m2m_also_quite_long_zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz = models.ManyToManyField(Person, blank=True)
73
73
m2m_also_quite_long_zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz = models.ManyToManyFieldAttributeChainFieeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeld
74
+
75
+ def test():
76
+ if True:
77
+ VLM_m2m = VLM.m2m_also_quite_long_zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz.through
78
+ allows_group_by_select_index = self.connection.features.allows_group_by_select_index
74
79
` ` `
75
80
76
81
## Output
@@ -152,6 +157,16 @@ m2m_also_quite_long_zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz = (
152
157
models.ManyToManyField(Person, blank=True)
153
158
)
154
159
m2m_also_quite_long_zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz = models.ManyToManyFieldAttributeChainFieeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeld
160
+
161
+
162
+ def test():
163
+ if True:
164
+ VLM_m2m = (
165
+ VLM.m2m_also_quite_long_zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz.through
166
+ )
167
+ allows_group_by_select_index = (
168
+ self.connection.features.allows_group_by_select_index
169
+ )
155
170
` ` `
156
171
157
172
You can’t perform that action at this time.
0 commit comments