From e7689f7961d423d9bed5d374682a70ebdfcaf2ce Mon Sep 17 00:00:00 2001 From: Yihau Chen Date: Thu, 1 Sep 2022 14:48:20 +0800 Subject: [PATCH] chore: bump shellcheck v0.8.0 (#27463) * bump shellcheck to stable verion, v0.8.0 * fix SC2086 * fix SC2269, https://www.shellcheck.net/wiki/SC2294 * fix SC2294 * do null and unset check for variable, FORCE_DELETE --- ci/shellcheck.sh | 2 +- net/gce.sh | 1 + net/net.sh | 6 +++--- net/scripts/colo-node-onfree.sh | 2 +- system-test/testnet-automation.sh | 2 +- 5 files changed, 7 insertions(+), 6 deletions(-) diff --git a/ci/shellcheck.sh b/ci/shellcheck.sh index 9612c8390b..1c93af633f 100755 --- a/ci/shellcheck.sh +++ b/ci/shellcheck.sh @@ -7,6 +7,6 @@ cd "$(dirname "$0")/.." ( set -x git ls-files -- '*.sh' ':(exclude)ci/semver_bash' \ - | xargs ci/docker-run.sh koalaman/shellcheck@sha256:fe24ab9a9b6b62d3adb162f4a80e006b6a63cae8c6ffafbae45772bab85e7294 --color=always --external-sources --shell=bash + | xargs ci/docker-run.sh koalaman/shellcheck:v0.8.0 --color=always --external-sources --shell=bash ) echo --- ok diff --git a/net/gce.sh b/net/gce.sh index 6c9e9b357f..1a4eb775e2 100755 --- a/net/gce.sh +++ b/net/gce.sh @@ -397,6 +397,7 @@ cloud_ForEachInstance() { declare name publicIp privateIp IFS=: read -r name publicIp privateIp zone < <(echo "$info") + # shellcheck disable=SC2294 eval "$cmd" "$name" "$publicIp" "$privateIp" "$zone" "$count" "$@" count=$((count + 1)) done diff --git a/net/net.sh b/net/net.sh index e77232330a..c61799340b 100755 --- a/net/net.sh +++ b/net/net.sh @@ -601,7 +601,7 @@ deploy() { if $bootstrapLeader; then SECONDS=0 declare bootstrapNodeDeployTime= - startBootstrapLeader "$nodeAddress" $nodeIndex "$netLogDir/bootstrap-validator-$ipAddress.log" + startBootstrapLeader "$nodeAddress" "$nodeIndex" "$netLogDir/bootstrap-validator-$ipAddress.log" bootstrapNodeDeployTime=$SECONDS $metricsWriteDatapoint "testnet-deploy net-bootnode-leader-started=1" @@ -609,7 +609,7 @@ deploy() { SECONDS=0 pids=() else - startNode "$ipAddress" $nodeType $nodeIndex + startNode "$ipAddress" "$nodeType" "$nodeIndex" # Stagger additional node start time. If too many nodes start simultaneously # the bootstrap node gets more rsync requests from the additional nodes than @@ -1124,7 +1124,7 @@ startnode) nodeType= nodeIndex= getNodeType - startNode "$nodeAddress" $nodeType $nodeIndex + startNode "$nodeAddress" "$nodeType" "$nodeIndex" ;; startclients) startClients diff --git a/net/scripts/colo-node-onfree.sh b/net/scripts/colo-node-onfree.sh index c541b210d1..e5af6a4df1 100644 --- a/net/scripts/colo-node-onfree.sh +++ b/net/scripts/colo-node-onfree.sh @@ -4,7 +4,7 @@ SOLANA_LOCK_FILE="${SOLANA_LOCK_FILE:?}" SECONDARY_DISK_MOUNT_POINT="${SECONDARY_DISK_MOUNT_POINT:?}" SSH_AUTHORIZED_KEYS="${SSH_AUTHORIZED_KEYS:?}" -FORCE_DELETE="${FORCE_DELETE}" +FORCE_DELETE="${FORCE_DELETE:?}" RC=false if [[ -f "${SOLANA_LOCK_FILE}" ]]; then diff --git a/system-test/testnet-automation.sh b/system-test/testnet-automation.sh index 4cf23222c0..00426e18d8 100755 --- a/system-test/testnet-automation.sh +++ b/system-test/testnet-automation.sh @@ -13,7 +13,7 @@ Test failed during step: ${STEP} Failure occured when running the following command: -$(eval echo "$@")" +$*" fi # shellcheck disable=SC2034