From 9377b3fb9bc7b53e10995c301fbf42df62bdb3dd Mon Sep 17 00:00:00 2001 From: Matt Lord Date: Thu, 26 Oct 2023 13:29:20 -0400 Subject: [PATCH] Tell shellcheck to follow source'd files. Signed-off-by: Matt Lord --- misc/git/hooks/shellcheck | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/misc/git/hooks/shellcheck b/misc/git/hooks/shellcheck index af9d8f8b37b..422022b2945 100755 --- a/misc/git/hooks/shellcheck +++ b/misc/git/hooks/shellcheck @@ -20,7 +20,9 @@ do # The -e SC1090,SC1091 suppressing warnings about trying to find # files imported with "source foo.sh". We only want to lint # the files modified as part of this current diff. - errors+=$(shellcheck -e SC1090,SC1091 "$file" 2>&1) + # The -x flag tells shellcheck to follow the files we source + # and properly validate them as well. + errors+=$(shellcheck -x -e SC1090,SC1091 "$file" 2>&1) done [ -z "$errors" ] && exit 0