Add further checks to the pre-commit hook

This commit is contained in:
Nick Chambers 2021-07-11 23:49:56 -05:00 committed by Nick Chambers
parent 32b421be82
commit a7e443a8cb
1 changed files with 2 additions and 2 deletions

View File

@ -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