Merge "Add some output to dib-lint"
This commit is contained in:
commit
d45d4d46c1
14
bin/dib-lint
14
bin/dib-lint
@ -58,6 +58,8 @@ error() {
|
|||||||
rc=1
|
rc=1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
echo "Running dib-lint in $(pwd)"
|
||||||
|
|
||||||
rc=0
|
rc=0
|
||||||
TMPDIR=$(mktemp -d /tmp/tmp.XXXXXXXXXX)
|
TMPDIR=$(mktemp -d /tmp/tmp.XXXXXXXXXX)
|
||||||
trap "rm -rf $TMPDIR" EXIT
|
trap "rm -rf $TMPDIR" EXIT
|
||||||
@ -70,6 +72,8 @@ for i in $(find elements -type f \
|
|||||||
-not -name \*.py \
|
-not -name \*.py \
|
||||||
-not -name \*.pyc); do
|
-not -name \*.pyc); do
|
||||||
|
|
||||||
|
echo "Checking $i"
|
||||||
|
|
||||||
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
|
||||||
@ -148,6 +152,8 @@ for i in $(find elements -type f \
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
echo "Checking indents..."
|
||||||
|
|
||||||
for i in $(find elements -type f -and -name '*.rst' -or -type f -executable); do
|
for i in $(find elements -type f -and -name '*.rst' -or -type f -executable); do
|
||||||
# Check for tab indentation
|
# Check for tab indentation
|
||||||
if ! excluded tabindent; then
|
if ! excluded tabindent; then
|
||||||
@ -170,6 +176,8 @@ if ! excluded mddocs; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
echo "Checking YAML & JSON parsing"
|
||||||
|
|
||||||
for i in $(find elements -name '*.yaml' \
|
for i in $(find elements -name '*.yaml' \
|
||||||
-o \( -name pkg-map -type f -a \! -executable \)); do
|
-o \( -name pkg-map -type f -a \! -executable \)); do
|
||||||
py_check="
|
py_check="
|
||||||
@ -192,4 +200,10 @@ sys.exit(1)"
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
if [[ $rc == 0 ]]; then
|
||||||
|
echo "PASS"
|
||||||
|
else
|
||||||
|
echo "*** FAIL: Some tests failed!"
|
||||||
|
fi
|
||||||
|
|
||||||
exit $rc
|
exit $rc
|
||||||
|
Loading…
Reference in New Issue
Block a user