google / google/yapf

SPLIT_BEFORE_EXPRESSION_AFTER_OPENING_PAREN appears to still be broken

Open
#709 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
14k
Forks
904
PR merge metrics
No merged PRs in 30d

Description

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?

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.