Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SPLIT_ARGUMENTS_WHEN_COMMA_TERMINATED doesn't considered? #551

Open
humitos opened this issue Apr 7, 2018 · 0 comments
Open

SPLIT_ARGUMENTS_WHEN_COMMA_TERMINATED doesn't considered? #551

humitos opened this issue Apr 7, 2018 · 0 comments

Comments

@humitos
Copy link

humitos commented Apr 7, 2018

Thank you all for this amazing command! I've beeing using this command in many different project with different rules and styles and it just rocks!

Today, I'm mixing this command with add-trailing-comma (https://github.com/asottile/add-trailing-comma) and while testing the run of both I found some strange behaviour in yapf.

It seems that SPLIT_ARGUMENTS_WHEN_COMMA_TERMINATED is not considered when running:

$ yapf --diff --style='{based_on_style: pep8, SPLIT_ARGUMENTS_WHEN_COMMA_TERMINATED: False}' trailing-example.py
--- trailing-example.py	(original)
+++ trailing-example.py	(reformatted)
@@ -1,4 +1,22 @@
 def myfunc(
-        a, b, c, d, e, f, argument, larger, here, to, reach, eighty, lines,
+        a,
+        b,
+        c,
+        d,
+        e,
+        f,
+        argument,
+        larger,
+        here,
+        to,
+        reach,
+        eighty,
+        lines,
 ):
-    a = [1, 2, 3, 4, 5,]
+    a = [
+        1,
+        2,
+        3,
+        4,
+        5,
+    ]
$ yapf --version
yapf 0.21.0

I supposed that it shouldn't change anything in the above example since it should not split when comman terminated. Am I missing something? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant