|
@@ -0,0 +1,64 @@
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+set -e
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+if ! command -v shellcheck; then
|
|
|
+ printf "%s: Install shellcheck to check shell scripts.\\n" "$0"
|
|
|
+ exit 0
|
|
|
+fi
|
|
|
+
|
|
|
+
|
|
|
+if command -v realpath ; then
|
|
|
+ HERE=$(dirname "$(realpath "$0")")
|
|
|
+else
|
|
|
+ HERE=$(dirname "$0")
|
|
|
+ if [ ! -d "$HERE" ]; then
|
|
|
+ HERE=$(dirname "$PWD/$0")
|
|
|
+ fi
|
|
|
+fi
|
|
|
+TOPLEVEL=$(dirname "$(dirname "$HERE")")
|
|
|
+
|
|
|
+
|
|
|
+if [ ! -d "$TOPLEVEL/src" ]; then
|
|
|
+ printf "Error: Couldn't find src directory in expected location: %s\\n" \
|
|
|
+ "$TOPLEVEL/src"
|
|
|
+fi
|
|
|
+
|
|
|
+
|
|
|
+find "$TOPLEVEL" \
|
|
|
+ -name "*.sh" \
|
|
|
+ -path "$TOPLEVEL/contrib/*" \
|
|
|
+ -path "$TOPLEVEL/doc/*" \
|
|
|
+ -path "$TOPLEVEL/scripts/*" \
|
|
|
+ -path "$TOPLEVEL/src/*" \
|
|
|
+ -not -path "$TOPLEVEL/src/ext/*" \
|
|
|
+ -not -path "$TOPLEVEL/src/rust/registry/*" \
|
|
|
+ -exec shellcheck {} +
|
|
|
+
|
|
|
+
|
|
|
+if [ -d "$TOPLEVEL/scripts/test" ]; then
|
|
|
+ shellcheck \
|
|
|
+ "$TOPLEVEL/scripts/test/cov-diff" \
|
|
|
+ "$TOPLEVEL/scripts/test/coverage"
|
|
|
+fi
|
|
|
+if [ -e \
|
|
|
+ "$TOPLEVEL/contrib/dirauth-tools/nagios-check-tor-authority-cert" \
|
|
|
+ ]; then
|
|
|
+ shellcheck \
|
|
|
+ "$TOPLEVEL/contrib/dirauth-tools/nagios-check-tor-authority-cert"
|
|
|
+fi
|
|
|
+if [ -e "$TOPLEVEL/contrib/client-tools/torify" ]; then
|
|
|
+ shellcheck "$TOPLEVEL/contrib/client-tools/torify"
|
|
|
+fi
|
|
|
+if [ -d "$TOPLEVEL/scripts/git" ]; then
|
|
|
+ shellcheck "$TOPLEVEL/scripts/git/"*.git-hook
|
|
|
+fi
|