Harmonize PEP8 checking between tox and run_tests.sh

Tox and run_tests.sh were running PEP8 checks against different
file-sets. This patch refactors the logic to determine which files to
run PEP8 checks on into `tools/run_pep8.sh` where it can be called by
both tox and `run_tests.sh`.

Additional fixes:

Some of our Python XenAPI Dom0 plugins don't end in *.py but should
still be checked by PEP8. This patches fixes the hacking.py violations
in the files and adds them back to the srcfiles list.

Merged tools/unused_imports.sh into tools/run_pep8.sh

Change-Id: Id5edd1acb644ab938beffc3473494a179d9d8cda
This commit is contained in:
Rick Harris
2013-02-13 23:33:20 +00:00
parent 4ffddcfa63
commit 0a93b563e9
7 changed files with 31 additions and 59 deletions
+1 -12
View File
@@ -18,18 +18,7 @@ downloadcache = ~/cache/pip
deps=
pep8==1.3.3
pyflakes
commands =
python tools/hacking.py --doctest
python tools/hacking.py --ignore=E12,E711,E721,E712,N403,N404,N303 \
--show-source \
--exclude=.venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build,./plugins/xenserver/networking/etc/xensource/scripts,./plugins/xenserver/xenapi/etc/xapi.d/plugins .
python tools/hacking.py --ignore=E12,E711,E721,E712,N403,N404,N303,N304 \
--show-source \
./plugins/xenserver/networking/etc/xensource/scripts \
./plugins/xenserver/xenapi/etc/xapi.d/plugins
python tools/hacking.py --ignore=E12,E711,E721,E712,N403,N404,N303 \
--show-source --filename=nova* bin
bash tools/unused_imports.sh
commands = bash tools/run_pep8.sh
[testenv:pylint]
setenv = VIRTUAL_ENV={envdir}