aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2016-01-13 22:03:39 +0000
committerGerrit Code Review <review@openstack.org>2016-01-13 22:03:39 +0000
commitcea76a1b866b16d8ca374d9a97e46930202be4b8 (patch)
tree33cb88756e8844a6c0c6e36100f04f0def6c4659
parent2d7dce6d26b6324e5fb104df65587ad7a8b6c1af (diff)
parentb863a46805c03ec755e7e69f1964d6231ed56ec5 (diff)
downloadkolla-cea76a1b866b16d8ca374d9a97e46930202be4b8.tar.gz
kolla-cea76a1b866b16d8ca374d9a97e46930202be4b8.zip
Merge "Standardize bashate and add linters"
-rw-r--r--.gitignore1
-rw-r--r--test-requirements.txt1
-rwxr-xr-xtools/run-bashate.sh7
-rw-r--r--tox.ini10
4 files changed, 15 insertions, 4 deletions
diff --git a/.gitignore b/.gitignore
index ed4957695..f575bf3ce 100644
--- a/.gitignore
+++ b/.gitignore
@@ -12,6 +12,7 @@
# Files generated by setup.py
kolla.egg-info
build
+.eggs
# Files generated by tools/genenv
openrc
diff --git a/test-requirements.txt b/test-requirements.txt
index 8a869a77e..dadf6274e 100644
--- a/test-requirements.txt
+++ b/test-requirements.txt
@@ -1,6 +1,7 @@
# The order of packages is significant, because pip processes them in the order
# of appearance. Changing the order has an impact on the overall integration
# process, which may cause wedges in the gate later.
+bashate>=0.2 # Apache-2.0
hacking>=0.10.0
oslo.log>=1.14.0 # Apache-2.0
oslotest>=1.10.0 # Apache-2.0
diff --git a/tools/run-bashate.sh b/tools/run-bashate.sh
new file mode 100755
index 000000000..897228c81
--- /dev/null
+++ b/tools/run-bashate.sh
@@ -0,0 +1,7 @@
+#!/bin/bash
+
+# Ignore E006 -- line length greater than 80 char
+
+ROOT=$(readlink -fn $(dirname $0)/.. )
+find $ROOT -not -wholename \*.tox/\* -and -not -wholename \*.test/\* \
+ -and -name \*.sh -print0 | xargs -0 bashate -v --ignore E006
diff --git a/tox.ini b/tox.ini
index 12fa0bc30..8634f614a 100644
--- a/tox.ini
+++ b/tox.ini
@@ -14,6 +14,11 @@ commands =
find . -type f -name "*.pyc" -delete
python setup.py test --slowest --testr-args='{posargs}'
+[testenv:linters]
+commands =
+ {toxinidir}/tools/run-bashate.sh
+ flake8 {posargs}
+
[testenv:pep8]
commands =
flake8
@@ -31,11 +36,8 @@ commands =
{toxinidir}/tools/validate-all-maintainer.sh
[testenv:bashate]
-deps = bashate
-whitelist_externals = bash
-# tox improperly interprets # and {1} in regex, so match on [[:punct:]]+
commands =
- bash -c "files=`egrep -rlI --exclude-dir .git --exclude-dir .tox '^[[:punct:]]+!/(bin/|/usr/bin/env )(ba)?sh' .` && bashate $files"
+ {toxinidir}/tools/run-bashate.sh
[testenv:setupenv]
whitelist_externals = bash