Switch to flake8 from pep8.

* flake8 supports more checks than pep8 (e.g. detection of
   unused imports and variables), and has an extension mechanism.
   A plugin to support automatic HACKING validation is planned.
 * See: http://flake8.readthedocs.org/

Change-Id: I8c9314c606802109a4d01908dbc74ecb792ad0ac
This commit is contained in:
Maru Newby 2013-04-04 04:10:23 +00:00
parent dc875b994e
commit 6041d4dd50
2 changed files with 12 additions and 7 deletions

View File

@ -4,13 +4,13 @@ coverage>=3.6
discover
distribute>=0.6.24
fixtures>=0.3.12
flake8
mock>=1.0b1
mox==0.5.3
nose
nosehtmloutput
nosexcover
openstack.nose_plugin
pep8==1.3.3
python-subunit
sphinx>=1.1.2
testrepository>=0.0.13

17
tox.ini
View File

@ -21,13 +21,8 @@ sitepackages = True
downloadcache = ~/cache/pip
[testenv:pep8]
# E711/E712 comparison to False should be 'if cond is False:' or 'if not cond:'
# query = query.filter(Component.disabled == False)
# E125 continuation line does not distinguish itself from next logical line
commands =
pep8 --repeat --show-source --ignore=E125,E711,E712 --exclude=.venv,.tox,dist,doc,openstack,*egg .
pep8 --repeat --show-source --ignore=E125 --filename=quantum* bin
flake8
[testenv:i18n]
commands = python ./tools/check_i18n.py ./quantum ./tools/i18n_cfg.py
@ -38,3 +33,13 @@ setenv = VIRTUAL_ENV={envdir}
[testenv:venv]
commands = {posargs}
[flake8]
# E711/E712 comparison to False should be 'if cond is False:' or 'if not cond:'
# query = query.filter(Component.disabled == False)
# E125 continuation line does not distinguish itself from next logical line
# H hacking.py - automatic checks of rules in HACKING.rst
ignore = E711,E712,E125,H
show-source = true
builtins = _
exclude=.venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,tools