Formatter: prefer_splitting_right_hand_side_of_assignments
preview style
#6975
Closed
Milestone
prefer_splitting_right_hand_side_of_assignments
preview style
#6975
Implement Black's improved linebreaks preview style. The style is gated behind the
prefer_splitting_right_hand_side_of_assignments
preview flag.It seems that the right side now always gets parenthesized regardless if it makes the right fit or not (no longer has the optimisation to omit parentheses if the content still doesn't fit after adding the parentheses).
https://play.ruff.rs/36e390bc-b3d2-41b2-80d9-87608337727a
We may be able to get away by simply not returning
BestFit
if the expression is an assignment value.I expect this change to improve the performance because there are fewer cases where we'll need to fall back to use Best Fitting.
Black (and our) stable style:
Preview style, which consistently breaks the right side first:
The text was updated successfully, but these errors were encountered: