Standardize bashate and add linters
The linters gate combindes pep8 and bashate (and then any other linters we want). This changes bashate to be a sript rather than doing a script inline. This matches the way other projects (and project-config themselves) uses bashate [1]. Once a change upstream merges we can remove the redundant pep8 and bashate gates. [1] https://github.com/openstack-infra/project-config/blob/master/tox.ini#L11 https://github.com/openstack-infra/project-config/blob/master/tools/run-bashate.sh Related-Id: I2afa7931bf3e18798b95a8af33ccf5ef761c4ad5 TrivialFix Change-Id: I2ea2c1156e1b4de008f19e333e2740795dc406de
This commit is contained in:
parent
8c4a2ee781
commit
b863a46805
1
.gitignore
vendored
1
.gitignore
vendored
@ -12,6 +12,7 @@
|
|||||||
# Files generated by setup.py
|
# Files generated by setup.py
|
||||||
kolla.egg-info
|
kolla.egg-info
|
||||||
build
|
build
|
||||||
|
.eggs
|
||||||
|
|
||||||
# Files generated by tools/genenv
|
# Files generated by tools/genenv
|
||||||
openrc
|
openrc
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
# The order of packages is significant, because pip processes them in the order
|
# 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
|
# of appearance. Changing the order has an impact on the overall integration
|
||||||
# process, which may cause wedges in the gate later.
|
# process, which may cause wedges in the gate later.
|
||||||
|
bashate>=0.2 # Apache-2.0
|
||||||
hacking>=0.10.0
|
hacking>=0.10.0
|
||||||
oslo.log>=1.14.0 # Apache-2.0
|
oslo.log>=1.14.0 # Apache-2.0
|
||||||
oslotest>=1.10.0 # Apache-2.0
|
oslotest>=1.10.0 # Apache-2.0
|
||||||
|
7
tools/run-bashate.sh
Executable file
7
tools/run-bashate.sh
Executable file
@ -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
|
10
tox.ini
10
tox.ini
@ -14,6 +14,11 @@ commands =
|
|||||||
find . -type f -name "*.pyc" -delete
|
find . -type f -name "*.pyc" -delete
|
||||||
python setup.py test --slowest --testr-args='{posargs}'
|
python setup.py test --slowest --testr-args='{posargs}'
|
||||||
|
|
||||||
|
[testenv:linters]
|
||||||
|
commands =
|
||||||
|
{toxinidir}/tools/run-bashate.sh
|
||||||
|
flake8 {posargs}
|
||||||
|
|
||||||
[testenv:pep8]
|
[testenv:pep8]
|
||||||
commands =
|
commands =
|
||||||
flake8
|
flake8
|
||||||
@ -31,11 +36,8 @@ commands =
|
|||||||
{toxinidir}/tools/validate-all-maintainer.sh
|
{toxinidir}/tools/validate-all-maintainer.sh
|
||||||
|
|
||||||
[testenv:bashate]
|
[testenv:bashate]
|
||||||
deps = bashate
|
|
||||||
whitelist_externals = bash
|
|
||||||
# tox improperly interprets # and {1} in regex, so match on [[:punct:]]+
|
|
||||||
commands =
|
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]
|
[testenv:setupenv]
|
||||||
whitelist_externals = bash
|
whitelist_externals = bash
|
||||||
|
Loading…
Reference in New Issue
Block a user