From 95fcd6433b45199999bffe0ab8c59fb9ee82b8c6 Mon Sep 17 00:00:00 2001 From: Jim Rollenhagen Date: Thu, 17 Dec 2015 17:45:30 +0000 Subject: [PATCH] Run bashate as part of the pep8 command In order to save gate resources we could just run bashate as part of the the pep8 command. The tox bashate command is removed and bashate is added as a dependency in the test-requirements.txt file. Change-Id: I75df4103c0154c5424b8781c1db3480336a5e1d2 --- test-requirements.txt | 1 + tox.ini | 35 ++++++++++++++++------------------- 2 files changed, 17 insertions(+), 19 deletions(-) diff --git a/test-requirements.txt b/test-requirements.txt index fc6c31f9d1..463c50f72b 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -17,6 +17,7 @@ os-testr>=0.4.1 testresources>=0.2.4 testscenarios>=0.4 WebTest>=2.0 +bashate>=0.2 # Apache-2.0 # Doc requirements sphinx!=1.2.0,!=1.3b1,<1.3,>=1.1.2 diff --git a/tox.ini b/tox.ini index 3111bdae3e..b9b3409089 100644 --- a/tox.ini +++ b/tox.ini @@ -26,6 +26,22 @@ commands = {toxinidir}/tools/states_to_dot.py -f {toxinidir}/doc/source/images/s whitelist_externals = bash commands = flake8 {posargs} + # Run bashate during pep8 runs to ensure violations are caught by + # the check and gate queues. + bash -c "find {toxinidir}/devstack \ + -not \( -type d -name .?\* -prune \) \ # prune all 'dot' dirs + -type f \ # only files + -not -name \*.swp \ # skip editor files + -not -name \*~ \ # skip editor files + -not -name \*.xml \ # skip xml files + -not -name \*.template \ # skip template files + -not -wholename \*scripts/configure-vm \ # that's a python script + \( \ + -name \*.sh -or \ # add files eding with .sh + -wholename \*/lib/\* -or \ # add files under lib/ + -wholename \*/tools/\* \ # add files under tools/ + \) \ + -print0 | xargs -0 bashate -v -iE006 -eE005,E042" # Check that .po and .pot files are valid: bash -c "find ironic -type f -regex '.*\.pot?' -print0|xargs -0 -n 1 msgfmt --check-format -o /dev/null" @@ -62,25 +78,6 @@ commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasen setenv = PYTHONHASHSEED=0 commands = {posargs} -[testenv:bashate] -deps = - {env:BASHATE_INSTALL_PATH:bashate==0.3.2} -whitelist_externals = bash -commands = bash -c "find {toxinidir}/devstack \ - -not \( -type d -name .?\* -prune \) \ # prune all 'dot' dirs - -type f \ # only files - -not -name \*.swp \ # skip editor files - -not -name \*~ \ # skip editor files - -not -name \*.xml \ # skip xml files - -not -name \*.template \ # skip template files - -not -wholename \*scripts/configure-vm \ # that's a python script - \( \ - -name \*.sh -or \ # add files eding with .sh - -wholename \*/lib/\* -or \ # add files under lib/ - -wholename \*/tools/\* \ # add files under tools/ - \) \ - -print0 | xargs -0 bashate -v -iE006 -eE005,E042" - [flake8] ignore = E129 exclude = .venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build,tools