List comp split penalties are set after trailer penalties
diff --git a/yapftests/reformatter_basic_test.py b/yapftests/reformatter_basic_test.py
index 843dd8d..f5ae90e 100644
--- a/yapftests/reformatter_basic_test.py
+++ b/yapftests/reformatter_basic_test.py
@@ -490,13 +490,12 @@
# If the queue isn't properly constructed, then a token in the middle of the
# line may be selected as the one with least penalty. The tokens after that
# one are then splatted at the end of the line with no formatting.
- # FIXME(morbo): The formatting here isn't ideal.
unformatted_code = """\
find_symbol(node.type) + "< " + " ".join(find_pattern(n) for n in node.child) + " >"
"""
expected_formatted_code = """\
-find_symbol(
- node.type) + "< " + " ".join(find_pattern(n) for n in node.child) + " >"
+find_symbol(node.type) + "< " + " ".join(find_pattern(n)
+ for n in node.child) + " >"
"""
uwlines = yapf_test_helper.ParseAndUnwrap(unformatted_code)
self.assertCodeEqual(expected_formatted_code, reformatter.Reformat(uwlines))
diff --git a/yapftests/reformatter_buganizer_test.py b/yapftests/reformatter_buganizer_test.py
index 3d040f8..c4a54d8 100644
--- a/yapftests/reformatter_buganizer_test.py
+++ b/yapftests/reformatter_buganizer_test.py
@@ -28,6 +28,17 @@
def setUpClass(cls):
style.SetGlobalStyle(style.CreateChromiumStyle())
+ def testB67455376(self):
+ unformatted_code = """\
+sponge_ids.extend(invocation.id() for invocation in self._client.GetInvocationsByLabels(labels))
+"""
+ expected_formatted_code = """\
+sponge_ids.extend(invocation.id()
+ for invocation in self._client.GetInvocationsByLabels(labels))
+"""
+ uwlines = yapf_test_helper.ParseAndUnwrap(unformatted_code)
+ self.assertCodeEqual(expected_formatted_code, reformatter.Reformat(uwlines))
+
def testB35210351(self):
unformatted_code = """\
def _():