Add pep8/flake8 checks, fix flake8 errors

We're starting to accumulate a number of python scripts in
various parts of the tree, and probably will continue to do so.
To make maintenance easier over time, we should have basic
pep8/flake8 checks in place for python code, as is best practice
elsewhere in the OpenStack project.  This patch adds basic checks
and corrects existing errors in our python scripts so that going
forward we can opt to gate on clean python code.

Change-Id: Ie32ee7a14ee608e12f42288e137a0849555b5ed8
This commit is contained in:
Mark T. Voelker
2015-08-07 23:33:20 -04:00
parent 19ac374a52
commit c8138d4fa5
6 changed files with 55 additions and 15 deletions

18
tox.ini
View File

@@ -1,4 +1,5 @@
[tox]
envlist = docs,doc8,pep8
minversion = 1.6
skipsdist = True
@@ -18,3 +19,20 @@ commands =
[testenv:docs]
commands=
python setup.py build_sphinx
[testenv:pep8]
basepython = python2.7
deps =
{[testenv]deps}
commands=
bash tools/flake8wrap.sh
whitelist_externals =
sh
bash
[flake8]
# E125 is deliberately excluded.
# See https://github.com/jcrocholl/pep8/issues/126
ignore = E125
exclude = .venv,.git,.tox,doc,conf.py