Standardize Armada code with YAPF

From recently merged document updates in [0] there is a desire to
standardize the Airship project python codebase.  This is the effort
to do so for the Armada project.

[0] https://review.opendev.org/#/c/671291/

Change-Id: I4fe916d6e330618ea3a1fccfa4bdfdfabb9ffcb2
This commit is contained in:
HUGHES, ALEXANDER (ah8742)
2019-07-24 14:27:20 -05:00
committed by Alexander Hughes
parent d404e3c034
commit b787c418e3
77 changed files with 1298 additions and 1182 deletions

18
tox.ini
View File

@@ -72,7 +72,7 @@ commands =
# Whitespace linter (for chart files)
bash {toxinidir}/tools/whitespace-linter.sh
yapf -dr {toxinidir}/armada {toxinidir}/setup.py
flake8 {posargs}
flake8 {toxinidir}/armada {toxinidir}/setup.py
# Run security linter as part of the pep8 gate instead of a separate zuul job.
bandit -r armada -n 5 -x armada/tests/*
@@ -94,7 +94,7 @@ commands =
coverage xml -o cover/coverage.xml
coverage report
[testenv:yapf]
[testenv:fmt]
basepython = python3
deps = {[testenv]deps}
commands =
@@ -102,8 +102,14 @@ commands =
[flake8]
filename = *.py
# These are ignored intentionally:
# W504 - line break after binary operator, we cannot have both
# W503 and W504 enabled
ignore = W504
show-source = true
# [H106] Don't put vim configuration in source files.
# [H201] No 'except:' at least use 'except Exception:'
# [H904] Delay string interpolations at logging calls.
enable-extensions = H106,H201,H904
# [W503] line break before binary operator
ignore = W503
exclude = .git,.tox,dist,*lib/python*,*egg,build,releasenotes,doc/*,hapi,venv
max-complexity = 24
application-import-names = armada
import-order-style = pep8