File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -117,16 +117,26 @@ else
117
117
fi
118
118
fi
119
119
120
+ # common arguments we'll pass to shellcheck
121
+ SHELLCHECK_OPTIONS=(
122
+ # allow following sourced files that are not specified in the command,
123
+ # we need this because we specify one file at at time in order to trivially
124
+ # detect which files are failing
125
+ " --external-sources"
126
+ # include our disabled lints
127
+ " --exclude=${SHELLCHECK_DISABLED} "
128
+ )
129
+
120
130
# lint each script, tracking failures
121
131
errors=()
122
132
not_failing=()
123
133
for f in " ${all_shell_scripts[@]} " ; do
124
134
set +o errexit
125
135
if ${HAVE_SHELLCHECK} ; then
126
- failedLint=$( shellcheck --exclude= " ${SHELLCHECK_DISABLED } " " ${f} " )
136
+ failedLint=$( shellcheck " ${SHELLCHECK_OPTIONS[@] } " " ${f} " )
127
137
else
128
138
failedLint=$( docker exec -t ${SHELLCHECK_CONTAINER} \
129
- shellcheck --exclude= " ${SHELLCHECK_DISABLED } " " ${f} " )
139
+ shellcheck " ${SHELLCHECK_OPTIONS[@] } " " ${f} " )
130
140
fi
131
141
set -o errexit
132
142
kube::util::array_contains " ${f} " " ${failing_files[@]} " && in_failing=$? || in_failing=$?
You can’t perform that action at this time.
0 commit comments