Merge "Add validate-json tox target"

This commit is contained in:
Jenkins 2014-10-03 18:44:45 +00:00 committed by Gerrit Code Review
commit 76a1602900
3 changed files with 31 additions and 0 deletions

1
test-requirements.txt Normal file
View File

@ -0,0 +1 @@
demjson

19
tools/validate-json.sh Executable file
View File

@ -0,0 +1,19 @@
#!/bin/bash
set -e
TMPFILE=$(mktemp)
ret=0
function clean {
rm -f ${TMPFILE}
}
trap clean EXIT
for f in $(find docker/ -type f -name '*.json');do
jsonlint -s ${f} >${TMPFILE}
egrep -q 'has errors$' ${TMPFILE} && { cat ${TMPFILE}; ret=1 ;}
done
cat ${TMPFILE}
exit ${ret}

11
tox.ini Normal file
View File

@ -0,0 +1,11 @@
[tox]
skipsdist = True
envlist = validate-json
minversion = 1.6
[testenv]
deps = -r{toxinidir}/test-requirements.txt
[testenv:validate-json]
commands =
{toxinidir}/tools/validate-json.sh