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.
# This mostly happens to multiline strings that are by definition
# 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:
split_funcs = [delimiter_split, standalone_comment_split, rhs]

View File

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

View File

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