trivial: fix yapf/pep8 interaction failing on logical operator

This adds a custom yapf config file with
split_before_logical_operator knob set to false so that
pep8 doesn't complain when:

    if (save_location and save_location != os.path.sep and
            save_location.endswith(os.path.sep)):

is wrongly converted to:

    if (save_location and save_location != os.path.sep
            and save_location.endswith(os.path.sep)):

This keeps the and on the first line as in the first example.

Change-Id: Ibf2813c3c969fd5f1cfd14936f3fecc9100283f7
This commit is contained in:
Felipe Monteiro 2018-11-25 12:29:24 -05:00 committed by Tin Lam
parent 5f866606a4
commit ca614beac7
2 changed files with 6 additions and 1 deletions

5
.style.yapf Normal file
View File

@ -0,0 +1,5 @@
[style]
based_on_style = pep8
spaces_before_comment = 2
column_limit = 79
split_before_logical_operator = false

View File

@ -24,7 +24,7 @@ basepython = python3
deps =
-r{toxinidir}/test-requirements.txt
commands =
yapf --style=pep8 -ir {toxinidir}/pegleg {toxinidir}/tests
yapf -ir {toxinidir}/pegleg {toxinidir}/tests
[testenv:pep8]
basepython = python3