From ac2a4abfca2885ae3bfb1f7cb40e57a488cba97d Mon Sep 17 00:00:00 2001 From: Stephen Finucane Date: Wed, 15 Mar 2017 15:57:23 +0000 Subject: [PATCH] Duplicate JSON line ending check to pep8 The docs job is not run in the gate, meaning invalid JSON files with \r\n line endings are able to sneak in. Duplicate the checks from the docs environment to the pep8 environment so that gate jobs run it. Note that pep8 is our general linting target and thus should include these kind of tests. Change-Id: Ie923902b04be79b9f66ba1841c60899a413f6439 Closes-Bug: #1673131 --- tox.ini | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tox.ini b/tox.ini index 4346773711ff..f5b683f484d5 100644 --- a/tox.ini +++ b/tox.ini @@ -39,6 +39,8 @@ commands = basepython = python2.7 commands = bash tools/flake8wrap.sh {posargs} + # Check that all JSON files don't have \r\n in line. + bash -c "! find doc/ -type f -name *.json | xargs grep -U -n $'\r'" # Check that all included JSON files are valid JSON bash -c '! find doc/ -type f -name *.json | xargs -t -n1 python -m json.tool 2>&1 > /dev/null | grep -B1 -v ^python'