From 7643f52fb228fa6b434feb57b77b6fd2d40f1636 Mon Sep 17 00:00:00 2001 From: Monty Taylor Date: Sat, 20 Apr 2013 23:22:39 -0700 Subject: [PATCH] Move to flake8. The project is standardizing on flake8 for static code analysis. Change-Id: I4fd97b56b6c6cb57e8d245281e0da15f838ec840 --- .pep8 | 4 ---- doc/source/conf.py | 2 +- run_tests.sh | 4 ++-- tools/test-requires | 8 ++++++-- tox.ini | 23 +++-------------------- 5 files changed, 12 insertions(+), 29 deletions(-) delete mode 100644 .pep8 diff --git a/.pep8 b/.pep8 deleted file mode 100644 index 9e4ea3741..000000000 --- a/.pep8 +++ /dev/null @@ -1,4 +0,0 @@ - -[pep8] -ignore = E121,E126,E127,E128,W602 -exclude = vcsversion.py,panel_template,dash_template,local_settings.py diff --git a/doc/source/conf.py b/doc/source/conf.py index 561b44076..297a68818 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -79,7 +79,7 @@ def write_autodoc_index(): if not(os.path.exists(MOD_DIR)): os.mkdir(MOD_DIR) for module in find_autodoc_modules(modulename, path): - if any([module.startswith(exclude) for exclude \ + if any([module.startswith(exclude) for exclude in EXCLUDED_MODULES]): print "Excluded module %s." % module continue diff --git a/run_tests.sh b/run_tests.sh index f2e7e5175..879cb9a0d 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -136,8 +136,8 @@ function run_pylint { } function run_pep8 { - echo "Running pep8 ..." - ${command_wrapper} pep8 $included_dirs + echo "Running flake8 ..." + ${command_wrapper} flake8 $included_dirs } function run_sphinx { diff --git a/tools/test-requires b/tools/test-requires index c1da7cae2..e027cee3f 100644 --- a/tools/test-requires +++ b/tools/test-requires @@ -1,5 +1,11 @@ distribute>=0.6.24 +# Install bounded pep8/pyflakes first, then let flake8 install +pep8==1.4.5 +pyflakes==0.7.2 +flake8==2.0 +hacking>=0.5.3,<0.6 + # Testing Requirements coverage django-nose @@ -9,8 +15,6 @@ nose-exclude nosexcover openstack.nose_plugin nosehtmloutput -pep8>=1.3 -pylint selenium # Docs Requirements diff --git a/tox.ini b/tox.ini index 0913e1e38..974ba9dbc 100644 --- a/tox.ini +++ b/tox.ini @@ -13,7 +13,6 @@ deps = -r{toxinidir}/tools/pip-requires commands = /bin/bash run_tests.sh -N [testenv:pep8] -deps = pep8 commands = /bin/bash run_tests.sh -N --pep8 [testenv:venv] @@ -25,22 +24,6 @@ commands = /bin/bash run_tests.sh -N --coverage [tox:jenkins] downloadcache = ~/cache/pip -[testenv:jenkins26] -setenv = NOSE_WITH_XUNIT=1 -basepython = python2.6 - -[testenv:jenkins27] -setenv = NOSE_WITH_XUNIT=1 -basepython = python2.7 - -[testenv:jenkinspep8] -setenv = NOSE_WITH_XUNIT=1 -commands = /bin/bash run_tests.sh -N --pep8 - -[testenv:jenkinscover] -setenv = NOSE_WITH_XUNIT=1 -commands = /bin/bash run_tests.sh -N --coverage - -[testenv:jenkinsvenv] -setenv = NOSE_WITH_XUNIT=1 -commands = {posargs} +[flake8] +exclude = .venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build,panel_template,dash_template,local_settings.py +ignore = E121,E126,E127,E128,W602,F,H