Fix shellcheck warnings in shell scripts

- Fix SC2125: Quote GOPRIVATE/GONOSUMDB values in ci_setup.sh
- Fix SC1091: Add source=/dev/null for dynamically sourced lib_luxd_clone.sh
- Fix unbound variable errors in shellcheck.sh for arrays and args
- Add -x flag to shellcheck for following sourced files
This commit is contained in:
2025-12-04 14:04:20 -08:00
parent 4fde3bde37
commit ed8e284175
4 changed files with 11 additions and 4 deletions
+1
View File
@@ -15,6 +15,7 @@ EVM_PATH=$( cd "$( dirname "${BASH_SOURCE[0]}" )"; cd .. && pwd )
# TODO(marun) Support use of a released node image if using a release version of luxd
source "${EVM_PATH}"/scripts/constants.sh
# shellcheck source=/dev/null
source "${EVM_PATH}"/scripts/lib_luxd_clone.sh
clone_luxd "${LUX_VERSION}"
+1
View File
@@ -92,6 +92,7 @@ if ! docker pull "${LUXD_NODE_IMAGE}"; then
LUXD_NODE_IMAGE="${LUXD_LOCAL_IMAGE_NAME}:${LUX_VERSION}"
echo "Building ${LUXD_NODE_IMAGE} locally"
# shellcheck source=/dev/null
source "${EVM_PATH}"/scripts/lib_luxd_clone.sh
clone_luxd "${LUX_VERSION}"
SKIP_BUILD_RACE=1 \
+6 -2
View File
@@ -46,10 +46,14 @@ fi
IGNORED_CONDITIONS=()
for file in ${IGNORED_FILES}; do
if [[ -n "${IGNORED_CONDITIONS-}" ]]; then
if [[ ${#IGNORED_CONDITIONS[@]} -gt 0 ]]; then
IGNORED_CONDITIONS+=(-o)
fi
IGNORED_CONDITIONS+=(-path "${REPO_ROOT}/${file}" -prune)
done
find "${REPO_ROOT}" \( "${IGNORED_CONDITIONS[@]}" \) -o -type f -name "*.sh" -print0 | xargs -0 "${SHELLCHECK}" "${@}"
if [[ ${#IGNORED_CONDITIONS[@]} -gt 0 ]]; then
find "${REPO_ROOT}" \( "${IGNORED_CONDITIONS[@]}" \) -o -type f -name "*.sh" -print0 | xargs -0 "${SHELLCHECK}" -x "${@:+$@}"
else
find "${REPO_ROOT}" -type f -name "*.sh" -print0 | xargs -0 "${SHELLCHECK}" -x "${@:+$@}"
fi