Add shellcheck wrapper script

Signed-off-by: Michael Richters <gedankenexperimenter@gmail.com>
pull/1155/head
Michael Richters 3 years ago
parent cbf98fd70b
commit 3de83322e5
No known key found for this signature in database
GPG Key ID: 1288FD13E4EEF0C0

@ -123,14 +123,8 @@ cpplint-noisy:
cpplint: cpplint:
bin/cpplint.py --config=.cpplint --quiet --recursive src plugins examples bin/cpplint.py --config=.cpplint --quiet --recursive src plugins examples
SHELL_FILES := $(shell if [ -d bin ]; then egrep -n -r -l "(env (ba)?sh)|(/bin/(ba)?sh)" bin; fi)
shellcheck: shellcheck:
@if [ -d "bin" ]; then \ bin/check-shell-scripts.sh
shellcheck ${SHELL_FILES}; \
fi
SMOKE_SKETCHES := $(sort $(shell if [ -d ./examples ]; then find ./examples -type f -name \*ino | xargs -n 1 dirname; fi)) SMOKE_SKETCHES := $(sort $(shell if [ -d ./examples ]; then find ./examples -type f -name \*ino | xargs -n 1 dirname; fi))

@ -0,0 +1,13 @@
#!/usr/bin/env bash
: "${KALEIDOSCOPE_DIR:=$(pwd)}"
cd "${KALEIDOSCOPE_DIR}" || exit 1
ERROR_COUNT=0
while read -r SCRIPT; do
shellcheck "${SCRIPT}"
(( ERROR_COUNT += $? ))
done < <(grep -E -n -r -l '(env (ba)?sh)|(/bin/(ba)?sh)' "${KALEIDOSCOPE_DIR}/bin")
exit $ERROR_COUNT
Loading…
Cancel
Save