The dedent_closing_brackets setting conflicts with PEP 8's indentation recommendation (E125)
When using {based_on_style: pep8, dedent_closing_brackets: true} as a style, PEP 8's indentation recommendation isn't followed when the test of an if statement is a logical expression.
Given the following check.py:
if (
0X000000000000000000000000 or 0X000000000000000000000000
) and (
0X000000000000000000000000 or 0X000000000000000000000000
):
pass
Running yapf --style "{based_on_style: pep8, dedent_closing_brackets: true}" yields this output:
if (0X000000000000000000000000 or 0X000000000000000000000000
) and (0X000000000000000000000000 or 0X000000000000000000000000):
pass
This raises flake8's E125 ("continuation line with same indent as next logical line").
I've tried adding continuation_align_style: 'VALIGN-RIGHT' to the style, but get the same result.
See also:
- #21 (continuation in
ifstatement) - #196 (continuation in function parameters)
- #197 (continuation in
forstatement) - #453 (continuation in
async withstatement) - #585 (continuation in
forstatement) - #600 (continuation in
exceptclause)
Version: yapf 0.30.0
is there any updates for this problem? I am using yapf 0.32.0
I am using yapf==0.40.0, this problem still exists.