google / google/yapf

split_before_first_argument inconsistent behavior

Open
#838 1 comment 1 reaction 0 assignees View on GitHub
Dominant language
Python
Stars
14k
Forks
904
PR merge metrics
No merged PRs in 30d

Description

I use "split_before_first_argument = false" with yapf of latest vesion 0.30. But I found the result is little inconsistent , for example,
```
order = COrder("objects", False, "", False, False, "","hhhhhhhhhhh", price=12555, vol=1)
```
the above code would be formated as :
```
order = COrder("objects",
False,
"",
False,
False,
"",
"hhhhhhhhhhh",
price=12555,
vol=1)
```
That is what it should be, but if I add a comment char '#' in one parameter line, like this:
```
order = COrder("objects",
False,
"",
False,
False,
"",
"hhhhhhhhhhh",
price=12555, #
vol=1)
```
then after reformattng, the 1st line is changed:
```
order = COrder(
"objects",
False,
"",
False,
False,
"",
"hhhhhhhhhhh",
price=12555, #
vol=1)
```

I wonder whether it is supposed to be so , or it is a bug.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.