From 6041d4dd5042348b1de29e72daec1d2e32b721eb Mon Sep 17 00:00:00 2001 From: Maru Newby Date: Thu, 4 Apr 2013 04:10:23 +0000 Subject: [PATCH] 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 --- tools/test-requires | 2 +- tox.ini | 17 +++++++++++------ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/tools/test-requires b/tools/test-requires index f7e962b25..a92a6d26f 100644 --- a/tools/test-requires +++ b/tools/test-requires @@ -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 diff --git a/tox.ini b/tox.ini index 32639098f..99cd84376 100644 --- a/tox.ini +++ b/tox.ini @@ -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