summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorZuul <zuul@review.openstack.org>2018-01-17 07:41:41 +0000
committerGerrit Code Review <review@openstack.org>2018-01-17 07:41:41 +0000
commitb1796384f77d934b266250997aea42d6dccd2872 (patch)
tree45a5fa5023c06d16c6f2dccfc8c82d48890fe9bd /tools
parentbfc3facdc816c9a8d23b04c01af0161354934232 (diff)
parent3364720f3435a7e5469e0f1ed0bce4c02e70af9d (diff)
downloadkolla-b1796384f77d934b266250997aea42d6dccd2872.tar.gz
kolla-b1796384f77d934b266250997aea42d6dccd2872.zip
Merge "Validate Dockerfile indentation in pep8"
Diffstat (limited to 'tools')
-rwxr-xr-xtools/validate-all-dockerfiles.sh10
-rwxr-xr-xtools/validate-indentation.sh12
2 files changed, 20 insertions, 2 deletions
diff --git a/tools/validate-all-dockerfiles.sh b/tools/validate-all-dockerfiles.sh
index 6f9aecde9..f9dabaa9c 100755
--- a/tools/validate-all-dockerfiles.sh
+++ b/tools/validate-all-dockerfiles.sh
@@ -3,9 +3,15 @@
REAL_PATH=$(python -c "import os,sys;print(os.path.realpath('$0'))")
cd "$(dirname "$REAL_PATH")/.."
+RES=0
+
+find docker -name Dockerfile.j2 -print0 |
+ xargs -0 tools/validate-maintainer.sh || RES=1
+
find docker -name Dockerfile.j2 -print0 |
- xargs -0 tools/validate-maintainer.sh || exit 1
+ xargs -0 tools/validate-install-command.sh || RES=1
find docker -name Dockerfile.j2 -print0 |
- xargs -0 tools/validate-install-command.sh || exit 1
+ xargs -0 tools/validate-indentation.sh || RES=1
+exit $RES
diff --git a/tools/validate-indentation.sh b/tools/validate-indentation.sh
new file mode 100755
index 000000000..de2f20c6f
--- /dev/null
+++ b/tools/validate-indentation.sh
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+RES=0
+
+for dockerfile in "$@"; do
+ if grep -qE '^\s+[A-Z]+\s' "$dockerfile"; then
+ echo "ERROR: $dockerfile has indented Dockerfile instruction" >&2
+ RES=1
+ fi
+done
+
+exit $RES