Add a bashate tox environment and address errors
Add a bashate environment for checking shell code quality. Exclude bashate warnings: E006: Line too long: E010: The "do" should be on same line as for In my opinion the places that trip these do not impact code readability Change-Id: Iab0a34542c3938f127515291eca8f027f3accaa0
This commit is contained in:
parent
6b09d8a6dc
commit
d827e71b22
@ -10,6 +10,7 @@ testtools>=1.4.0 # MIT
|
|||||||
virtualenv>=13.1.0 # MIT
|
virtualenv>=13.1.0 # MIT
|
||||||
setuptools!=24.0.0,!=34.0.0,!=34.0.1,!=34.0.2,!=34.0.3,!=34.1.0,!=34.1.1,!=34.2.0,!=34.3.0,!=34.3.1,!=34.3.2,!=36.2.0,>=16.0 # PSF/ZPL
|
setuptools!=24.0.0,!=34.0.0,!=34.0.1,!=34.0.2,!=34.0.3,!=34.1.0,!=34.1.1,!=34.2.0,!=34.3.0,!=34.3.1,!=34.3.2,!=36.2.0,>=16.0 # PSF/ZPL
|
||||||
mock>=2.0.0 # BSD
|
mock>=2.0.0 # BSD
|
||||||
|
bashate>=0.5.1 # Apache-2.0
|
||||||
|
|
||||||
# this is required for the docs build jobs
|
# this is required for the docs build jobs
|
||||||
sphinx>=1.6.2 # BSD
|
sphinx>=1.6.2 # BSD
|
||||||
|
@ -33,8 +33,7 @@
|
|||||||
|
|
||||||
versions="$*"
|
versions="$*"
|
||||||
|
|
||||||
if [ -z "$versions" ]
|
if [ -z "$versions" ] ; then
|
||||||
then
|
|
||||||
echo "ERROR: Usage: $0 <version>" 1>&2
|
echo "ERROR: Usage: $0 <version>" 1>&2
|
||||||
echo "Example: $0 2.7 3.3 3.4" 1>&2
|
echo "Example: $0 2.7 3.3 3.4" 1>&2
|
||||||
exit 1
|
exit 1
|
||||||
|
@ -14,13 +14,14 @@
|
|||||||
|
|
||||||
# Note(tonyb): Expand HEAD into something that's hopefully more human
|
# Note(tonyb): Expand HEAD into something that's hopefully more human
|
||||||
# readable
|
# readable
|
||||||
declare -a branches=($(git describe --always) origin/master
|
declare -a branches=(
|
||||||
origin/stable/pike
|
$(git describe --always) origin/master
|
||||||
origin/stable/ocata
|
origin/stable/pike
|
||||||
origin/stable/newton
|
origin/stable/ocata
|
||||||
|
origin/stable/newton
|
||||||
)
|
)
|
||||||
|
|
||||||
function search() {
|
function search {
|
||||||
git grep -hEi "^${1}[=><!]" ${2} -- "${3}"
|
git grep -hEi "^${1}[=><!]" ${2} -- "${3}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -12,8 +12,7 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
function get_from_git()
|
function get_from_git {
|
||||||
{
|
|
||||||
ref=$1
|
ref=$1
|
||||||
series=$2
|
series=$2
|
||||||
path=${3:-publish/constraints/upper}
|
path=${3:-publish/constraints/upper}
|
||||||
@ -32,7 +31,7 @@ stable/*)
|
|||||||
get_from_git origin/$ZUUL_BRANCH $series
|
get_from_git origin/$ZUUL_BRANCH $series
|
||||||
;;
|
;;
|
||||||
master)
|
master)
|
||||||
# NOTE(tonyb): Publish EOL'd constraints files. We do this here as a
|
# NOTE(tonyb): Publish EOL'd constraints files. We do this here as a
|
||||||
# quick way to publish the data. It can be removed anytime after the first
|
# quick way to publish the data. It can be removed anytime after the first
|
||||||
# successful run
|
# successful run
|
||||||
for tag in juno-eol kilo-eol liberty-eol mitaka-eol ; do
|
for tag in juno-eol kilo-eol liberty-eol mitaka-eol ; do
|
||||||
|
9
tox.ini
9
tox.ini
@ -42,6 +42,15 @@ commands = validate-projects {toxinidir}/projects.txt
|
|||||||
[testenv:pep8]
|
[testenv:pep8]
|
||||||
commands = flake8
|
commands = flake8
|
||||||
|
|
||||||
|
[testenv:bashate]
|
||||||
|
whitelist_externals = bash
|
||||||
|
# E006: Line too long:
|
||||||
|
# E010: The "do" should be on same line as for
|
||||||
|
commands = bash -c "find {toxinidir}/tools \
|
||||||
|
-type f \
|
||||||
|
-name \*.sh \
|
||||||
|
-print0 | xargs -0 bashate -v -iE006,E010"
|
||||||
|
|
||||||
[testenv:docs]
|
[testenv:docs]
|
||||||
commands = python setup.py build_sphinx
|
commands = python setup.py build_sphinx
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user