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