Loading src/black/__init__.py +5 −2 Changes for src/black/__init__.py: 5 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -3507,9 +3507,12 @@ def __get_max_string_length(self, line: Line, string_idx: int) -> int: # WMA4 a single space. offset += 1 # WMA4 the lengths of any leaves that came before that space. for leaf in LL[: p_idx + 1]: # WMA4 the lengths of any leaves that came before that space, # but after any closing bracket before that space. for leaf in reversed(LL[: p_idx + 1]): offset += len(str(leaf)) if leaf.type in CLOSING_BRACKETS: break if is_valid_index(string_idx + 1): N = LL[string_idx + 1] Loading tests/data/long_strings__regression.py +9 −0 Changes for tests/data/long_strings__regression.py: 9 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -349,6 +349,10 @@ def xxxxxxx_xxxxxx(xxxx): x.xxxxx.xxxxxx.xxxxx.xxxx, ], ("xxxxxxxxxxx xxxxxxx xxxx (xxxxxx xxxx) %x xxx xxxxx" % xxxxxxx_xxxx) value.__dict__[ key ] = "test" # set some Thrift field to non-None in the struct aa bb cc dd ee # output Loading Loading @@ -784,3 +788,8 @@ def xxxxxxx_xxxxxx(xxxx): ], ( "xxxxxxxxxxx xxxxxxx xxxx (xxxxxx xxxx) %x xxx xxxxx" % xxxxxxx_xxxx ) value.__dict__[ key ] = "test" # set some Thrift field to non-None in the struct aa bb cc dd ee Loading
src/black/__init__.py +5 −2 Changes for src/black/__init__.py: 5 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -3507,9 +3507,12 @@ def __get_max_string_length(self, line: Line, string_idx: int) -> int: # WMA4 a single space. offset += 1 # WMA4 the lengths of any leaves that came before that space. for leaf in LL[: p_idx + 1]: # WMA4 the lengths of any leaves that came before that space, # but after any closing bracket before that space. for leaf in reversed(LL[: p_idx + 1]): offset += len(str(leaf)) if leaf.type in CLOSING_BRACKETS: break if is_valid_index(string_idx + 1): N = LL[string_idx + 1] Loading
tests/data/long_strings__regression.py +9 −0 Changes for tests/data/long_strings__regression.py: 9 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -349,6 +349,10 @@ def xxxxxxx_xxxxxx(xxxx): x.xxxxx.xxxxxx.xxxxx.xxxx, ], ("xxxxxxxxxxx xxxxxxx xxxx (xxxxxx xxxx) %x xxx xxxxx" % xxxxxxx_xxxx) value.__dict__[ key ] = "test" # set some Thrift field to non-None in the struct aa bb cc dd ee # output Loading Loading @@ -784,3 +788,8 @@ def xxxxxxx_xxxxxx(xxxx): ], ( "xxxxxxxxxxx xxxxxxx xxxx (xxxxxx xxxx) %x xxx xxxxx" % xxxxxxx_xxxx ) value.__dict__[ key ] = "test" # set some Thrift field to non-None in the struct aa bb cc dd ee