Skip to content

Commit

Permalink
Tell shellcheck to follow sourced files (#14377)
Browse files Browse the repository at this point in the history
Signed-off-by: Matt Lord <[email protected]>
  • Loading branch information
mattlord authored Oct 27, 2023
1 parent 0d07456 commit 823b0a6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion misc/git/hooks/shellcheck
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 823b0a6

Please sign in to comment.