line_length=1 to reduce churn (#1092)

This commit is contained in:
Jelle Zijlstra 2019-10-28 07:25:42 -07:00 committed by Łukasz Langa
parent 6dca5278a3
commit e027fc9e75
3 changed files with 21 additions and 15 deletions

View File

@ -2406,7 +2406,9 @@ def rhs(line: Line, features: Collection[Feature]) -> Iterator[Line]:
# All splits failed, best effort split with no omits. # All splits failed, best effort split with no omits.
# This mostly happens to multiline strings that are by definition # This mostly happens to multiline strings that are by definition
# reported as not fitting a single line. # reported as not fitting a single line.
yield from right_hand_split(line, line_length, features=features) # line_length=1 is silly, but somehow produces better formatting
# than other things we've tried so far. See #762 and #781.
yield from right_hand_split(line, line_length=1, features=features)
if line.inside_brackets: if line.inside_brackets:
split_funcs = [delimiter_split, standalone_comment_split, rhs] split_funcs = [delimiter_split, standalone_comment_split, rhs]

View File

@ -144,9 +144,10 @@
print("foo %r", (foo.bar,)) print("foo %r", (foo.bar,))
if True: if True:
IGNORED_TYPES_FOR_ATTRIBUTE_CHECKING = Config.IGNORED_TYPES_FOR_ATTRIBUTE_CHECKING | { IGNORED_TYPES_FOR_ATTRIBUTE_CHECKING = (
pylons.controllers.WSGIController Config.IGNORED_TYPES_FOR_ATTRIBUTE_CHECKING
} | {pylons.controllers.WSGIController}
)
if True: if True:
ec2client.get_waiter("instance_stopped").wait( ec2client.get_waiter("instance_stopped").wait(

View File

@ -166,14 +166,17 @@ def tricky_asserts(self) -> None:
_C.__init__.__code__.co_firstlineno + 1, _C.__init__.__code__.co_firstlineno + 1,
) )
assert expectedexpectedexpectedexpectedexpectedexpectedexpectedexpectedexpect == { assert (
key1: value1, expectedexpectedexpectedexpectedexpectedexpectedexpectedexpectedexpect
key2: value2, == {
key3: value3, key1: value1,
key4: value4, key2: value2,
key5: value5, key3: value3,
key6: value6, key4: value4,
key7: value7, key5: value5,
key8: value8, key6: value6,
key9: value9, key7: value7,
} key8: value8,
key9: value9,
}
)