Merge "indent: search for !=4 spaces indentation"

This commit is contained in:
Jenkins 2014-05-14 08:33:22 +00:00 committed by Gerrit Code Review
commit 5b16eb0c33

View File

@ -45,12 +45,18 @@ trap "rm -rf $TMPDIR" EXIT
for i in $(find elements -type f); do
exclusions=("$(parse_exclusions $i)")
# Check that files starting with a shebang are +x
if ! excluded executable; then
firstline=$(head -n 1 "$i")
if [ ! -x "$i" ] && [ "${firstline:0:2}" = "#!" ]; then
if [ "${firstline:0:2}" = "#!" ]; then
if [ ! -x "$i" ] && ! excluded executable; then
echo "ERROR: $i is not executable"
rc=1
fi
# Ensure 4 spaces indent are used
if grep -q "^ \{4\}* \{1,3\}[^ ]" ${i}; then
echo "ERROR: $i should use 4 spaces indent"
rc=1
fi
fi
# Check alphabetical ordering of element-deps