From 0c3daa28753806e4c49bd31d6ab54afb36009c4a Mon Sep 17 00:00:00 2001 From: Denis Costa Date: Sat, 14 Dec 2024 19:08:05 -0300 Subject: [PATCH] Ignore lint for wait for it --- .docker/wait-for-it.sh | 7 +++++-- scripts/lint-sh.sh | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.docker/wait-for-it.sh b/.docker/wait-for-it.sh index 4c590bf6..f6167692 100755 --- a/.docker/wait-for-it.sh +++ b/.docker/wait-for-it.sh @@ -1,7 +1,10 @@ #!/usr/bin/env bash +# shellcheck disable=all # Use this script to test if a given TCP host/port are available # https://github.com/vishnubob/wait-for-it +# set -euo pipefail + WAITFORIT_cmdname=${0##*/} echoerr() { if [[ $WAITFORIT_QUIET -ne 1 ]]; then echo "$@" 1>&2; fi } @@ -63,9 +66,9 @@ wait_for_wrapper() wait $WAITFORIT_PID WAITFORIT_RESULT=$? if [[ $WAITFORIT_RESULT -ne 0 ]]; then - echoerr "$WAITFORIT_cmdname: timeout occurred after waiting $WAITFORIT_TIMEOUT seconds for $WAITFORIT_HOST:$WAITFORIT_PORT" + echoerr "$WAITFORIT_cmdname: timeout occurred after waiting ${WAITFORIT_TIMEOUT} seconds for $WAITFORIT_HOST:$WAITFORIT_PORT" fi - return $WAITFORIT_RESULT + return ${WAITFORIT_RESULT} } # process arguments diff --git a/scripts/lint-sh.sh b/scripts/lint-sh.sh index 57e3bf3f..751fabe7 100755 --- a/scripts/lint-sh.sh +++ b/scripts/lint-sh.sh @@ -6,6 +6,7 @@ SH_SCRIPTS=$(find . -name '*.sh') EXIT_STATUS=0 for script in ${SH_SCRIPTS}; do + [[ ${script} == './.docker/wait-for-it.sh' ]] && continue grep '^set -euo pipefail' "${script}" > /dev/null 2>&1 && continue EXIT_STATUS=1