yapf icon indicating copy to clipboard operation
yapf copied to clipboard

split_before_first_argument inconsistent behavior

Open dbsxdbsx opened this issue 4 years ago • 1 comments

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.

dbsxdbsx avatar May 06 '20 04:05 dbsxdbsx

.;.<

ID90625001X avatar May 11 '21 14:05 ID90625001X