summaryrefslogtreecommitdiff
path: root/tools/validate-indentation.sh
blob: 5fc1057cff4d7eb1ecfa68f550942db444eb9e33 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/bash

RES=0

for dockerfile in "$@"; do
    if grep -qE '^\s+[[:upper:]]+\s+' "$dockerfile"; then
        echo "ERROR: $dockerfile has indented Dockerfile instruction" >&2
        grep -E '^\s+[[:upper:]]+\s+' "$dockerfile"
        RES=1
    fi

    if grep -qE '^\s+\{\{ macros\.install_packages' "$dockerfile"; then
        echo "ERROR: $dockerfile has indented Dockerfile instruction" >&2
        grep -E '^\s+\{\{ macros\.install_packages' "$dockerfile"
        RES=1
    fi
done

exit $RES