From a7e443a8cbf564ad93801b3943a382a8ea68b645 Mon Sep 17 00:00:00 2001 From: Nick Chambers Date: Sun, 11 Jul 2021 23:49:56 -0500 Subject: [PATCH] Add further checks to the pre-commit hook --- pre-commit | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pre-commit b/pre-commit index 1308f40..b10e083 100755 --- a/pre-commit +++ b/pre-commit @@ -20,8 +20,8 @@ git status -zu | while read -rd '' xy filename; do fi if [[ $filename = *.sh ]] || is_a "$filename" bash; then - if has shellcheck && ! shellcheck -s bash "$filename"; then - exit 1 + if has shellcheck; then + grep -vq "declare -p" "$filename" && shellcheck -s bash "$filename" fi fi done