yapf
yapf copied to clipboard
SPLIT_BEFORE_EXPRESSION_AFTER_OPENING_PAREN appears to still be broken
Although https://github.com/google/yapf/pull/689 fixed some issues with setting
SPLIT_BEFORE_EXPRESSION_AFTER_OPENING_PAREN = False
I am still seeing incorrect formatting that https://github.com/google/yapf/pull/689 should have fixed. I'm using v0.27.0. See the below example of a script where yapf splits after the opening paren:
$ cat test.py
if True:
if True:
function(app is not None, "Job must be created with an app -"
"no app found for job {}".format(self.id))
$ yapf --style='{based_on_style: pep8, SPLIT_BEFORE_EXPRESSION_AFTER_OPENING_PAREN = False}' test.py
if True:
if True:
function(
app is not None, "Job must be created with an app -"
"no app found for job {}".format(self.id))
$ yapf --version
yapf 0.27.0
Why is function(
on its own line?
I got similiar issue with split_before_first_argument:false
and SPLIT_COMPLEX_COMPREHENSION=true
This still exists for yapf version 0.31.0. Notice that function
is on its own line, even though split_before_first_argument
is false. Any idea why?