summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/tools/html5lib/flake8-run.sh
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/tools/html5lib/flake8-run.sh')
-rwxr-xr-xtesting/web-platform/tests/tools/html5lib/flake8-run.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/testing/web-platform/tests/tools/html5lib/flake8-run.sh b/testing/web-platform/tests/tools/html5lib/flake8-run.sh
new file mode 100755
index 000000000..d1a587d35
--- /dev/null
+++ b/testing/web-platform/tests/tools/html5lib/flake8-run.sh
@@ -0,0 +1,14 @@
+#!/bin/bash -e
+
+if [[ ! -x $(which flake8) ]]; then
+ echo "fatal: flake8 not found on $PATH. Exiting."
+ exit 1
+fi
+
+if [[ $TRAVIS != "true" || $FLAKE == "true" ]]; then
+ find html5lib/ -name '*.py' -and -not -name 'constants.py' -print0 | xargs -0 flake8 --ignore=E501
+ flake1=$?
+ flake8 --max-line-length=99 --ignore=E126 html5lib/constants.py
+ flake2=$?
+ exit $[$flake1 || $flake2]
+fi