diff --git a/test-requirements.txt b/test-requirements.txt new file mode 100644 index 0000000000..df7e22df38 --- /dev/null +++ b/test-requirements.txt @@ -0,0 +1 @@ +demjson diff --git a/tools/validate-json.sh b/tools/validate-json.sh new file mode 100755 index 0000000000..c4d1f39246 --- /dev/null +++ b/tools/validate-json.sh @@ -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} diff --git a/tox.ini b/tox.ini new file mode 100644 index 0000000000..5a3f84656a --- /dev/null +++ b/tox.ini @@ -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