Merge "indent: search for !=4 spaces indentation"
This commit is contained in:
commit
5b16eb0c33
10
bin/dib-lint
10
bin/dib-lint
@ -45,12 +45,18 @@ trap "rm -rf $TMPDIR" EXIT
|
|||||||
for i in $(find elements -type f); do
|
for i in $(find elements -type f); do
|
||||||
exclusions=("$(parse_exclusions $i)")
|
exclusions=("$(parse_exclusions $i)")
|
||||||
# Check that files starting with a shebang are +x
|
# Check that files starting with a shebang are +x
|
||||||
if ! excluded executable; then
|
|
||||||
firstline=$(head -n 1 "$i")
|
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"
|
echo "ERROR: $i is not executable"
|
||||||
rc=1
|
rc=1
|
||||||
fi
|
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
|
fi
|
||||||
|
|
||||||
# Check alphabetical ordering of element-deps
|
# Check alphabetical ordering of element-deps
|
||||||
|
Loading…
Reference in New Issue
Block a user