Unverified Commit 70a1e504 authored by Kubernetes Prow Robot's avatar Kubernetes Prow Robot Committed by GitHub

Merge pull request #75977 from BenTheElder/meta-checked

enable external sources in verify-shellcheck
parents a38fdcfe 2b7cc095
......@@ -117,16 +117,26 @@ else
fi
fi
# common arguments we'll pass to shellcheck
SHELLCHECK_OPTIONS=(
# allow following sourced files that are not specified in the command,
# we need this because we specify one file at at time in order to trivially
# detect which files are failing
"--external-sources"
# include our disabled lints
"--exclude=${SHELLCHECK_DISABLED}"
)
# lint each script, tracking failures
errors=()
not_failing=()
for f in "${all_shell_scripts[@]}"; do
set +o errexit
if ${HAVE_SHELLCHECK}; then
failedLint=$(shellcheck --exclude="${SHELLCHECK_DISABLED}" "${f}")
failedLint=$(shellcheck "${SHELLCHECK_OPTIONS[@]}" "${f}")
else
failedLint=$(docker exec -t ${SHELLCHECK_CONTAINER} \
shellcheck --exclude="${SHELLCHECK_DISABLED}" "${f}")
shellcheck "${SHELLCHECK_OPTIONS[@]}" "${f}")
fi
set -o errexit
kube::util::array_contains "${f}" "${failing_files[@]}" && in_failing=$? || in_failing=$?
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment