Describe the style change
Hello,
We noticed that Black breaks long chains of assignments into multiple lines in a very unexpected way.
Example source code
AA = BB = CC = DD = EE = FF = GG = HH = JJ = KK = LL = MM = NN = OO = PP = QQ = RR = SS = TT = UU = WW = XX = YY = ZZ = 1
Examples in the current Black style
Black formats it in this way (last line is matched to max line length, but previous elements get 2 lines per one element):
AA = (
BB
) = (
CC
) = (
DD
) = (
EE
) = (
FF
) = (
GG
) = (
HH
) = JJ = KK = LL = MM = NN = OO = PP = QQ = RR = SS = TT = UU = WW = XX = YY = ZZ = 1
Desired style
We would expect that all lines would break at max line length, and that the last line would be shorter.
We are not sure what would the desired splitting format, here are some propositions to be discussed:
#1
AA = BB = CC = DD = EE = FF = GG = HH = JJ = KK = LL = MM = NN = OO = PP = QQ = (
RR ) = SS = TT = UU = WW = XX = YY = ZZ = 1
#2
AA = BB = CC = DD = EE = FF = GG = HH = JJ = KK = LL = MM = NN = OO = PP = ( QQ
) = RR = SS = TT = UU = WW = XX = YY = ZZ = 1
#3 - looks the best for me
AA = BB = CC = DD = EE = FF = GG = HH = JJ = KK = LL = MM = NN = OO = PP = QQ = (
RR ) = SS = TT = UU = WW = XX = YY = ZZ = 1
#4
AA = BB = CC = DD = EE = FF = GG = HH = JJ = KK = LL = MM = NN = OO = PP = QQ = (
RR
) = SS = TT = UU = WW = XX = YY = ZZ = 1
#5
AA = BB = CC = DD = EE = FF = GG = HH = JJ = KK = LL = MM = NN = OO = PP = QQ = \
RR = SS = TT = UU = WW = XX = YY = ZZ = 1
All of above cases look more usable than currently formatted version.
Additional context
This a legitimate minified case from code, where we needed to assign a lot of alias names to an Enum field.
Describe the style change
Hello,
We noticed that Black breaks long chains of assignments into multiple lines in a very unexpected way.
Example source code
Examples in the current Black style
Black formats it in this way (last line is matched to max line length, but previous elements get 2 lines per one element):
Desired style
We would expect that all lines would break at max line length, and that the last line would be shorter.
We are not sure what would the desired splitting format, here are some propositions to be discussed:
All of above cases look more usable than currently formatted version.
Additional context
This a legitimate minified case from code, where we needed to assign a lot of alias names to an Enum field.