From 0824cb0ad7cf47116e9ffab84051a4406cecb658 Mon Sep 17 00:00:00 2001 From: "Walter.Kolczynski" Date: Thu, 29 Sep 2022 20:10:54 +0000 Subject: [PATCH] Disable shellcheck on sourced scripts Turns off shellcheck parsing sourced scripts and removes some shellcheck directives that are no longer necessary. --- .shellcheckrc | 4 ++-- jobs/JGLOBAL_ATMOS_POST | 5 ----- scripts/exgdas_atmos_post.sh | 1 - ush/gfs_post.sh | 1 + 4 files changed, 3 insertions(+), 8 deletions(-) diff --git a/.shellcheckrc b/.shellcheckrc index 3628e97e586..1a4c5fdd63f 100644 --- a/.shellcheckrc +++ b/.shellcheckrc @@ -1,7 +1,7 @@ # Global settings for Spellcheck (https://github.com/koalaman/shellcheck) enable=all +external-sources=false + # Disable variable referenced but not assigned disable=SC2154 - - diff --git a/jobs/JGLOBAL_ATMOS_POST b/jobs/JGLOBAL_ATMOS_POST index 1a19a72bfff..ab75918aa63 100755 --- a/jobs/JGLOBAL_ATMOS_POST +++ b/jobs/JGLOBAL_ATMOS_POST @@ -1,6 +1,5 @@ #! /usr/bin/env bash -# shellcheck source=ush/preamble.sh source "${HOMEgfs}/ush/preamble.sh" export RUN_ENVIR=${RUN_ENVIR:-"nco"} @@ -12,7 +11,6 @@ configs="base post" export EXPDIR=${EXPDIR:-${HOMEgfs}/parm/config} config_path=${EXPDIR:-${PACKAGEROOT}/gfs.${gfs_ver}/parm/config} for config in ${configs}; do - # shellcheck source-path=parm/config . "${config_path}/config.${config}" status=$? (( status != 0 )) && exit "${status}" @@ -22,7 +20,6 @@ done ########################################## # Source machine runtime environment ########################################## -# shellcheck source-path=env . "${HOMEgfs}/env/${machine}.env" post status=$? (( status != 0 )) && exit "${status}" @@ -43,9 +40,7 @@ cd "${DATA}" || exit 1 ############################################## export cycle="t${cyc}z" setpdy.sh -# shellcheck disable=SC1091 . ./PDY -# shellcheck disable= ############################################## diff --git a/scripts/exgdas_atmos_post.sh b/scripts/exgdas_atmos_post.sh index aa3f7989905..a1753b7fe85 100755 --- a/scripts/exgdas_atmos_post.sh +++ b/scripts/exgdas_atmos_post.sh @@ -24,7 +24,6 @@ # echo "-----------------------------------------------------" ##################################################################### -# shellcheck source=ush/preamble.sh source "${HOMEgfs}/ush/preamble.sh" cd "${DATA}" || exit 1 diff --git a/ush/gfs_post.sh b/ush/gfs_post.sh index e36276a3868..7fbb19bb707 100755 --- a/ush/gfs_post.sh +++ b/ush/gfs_post.sh @@ -214,6 +214,7 @@ export POSTGPEXEC=${POSTGPEXEC:-${EXECgfs}/upp.x} export OVERPARMEXEC=${OVERPARMEXEC:-${EXECgfs}/overparm_grib} export POSTGPLIST=${POSTGPLIST:-/dev/null} export INISCRIPT=${INISCRIPT:-} +# Ignore warning about single quote not subtituting now # shellcheck disable=SC2016 export ERRSCRIPT=${ERRSCRIPT:-'eval (( err == 0 ))'} # shellcheck disable=