check_format: Make use of shellcheck's -x conditional
-x is supported since 0.4.0 release, make a note of that. Signed-off-by: Michal Berger <michalx.berger@intel.com> Change-Id: Icc64132536c18108029f6c5fa2cbdd5b27018d8b Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7417 Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com> Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Community-CI: Mellanox Build Bot
This commit is contained in:
parent
af661f7844
commit
ec632be24f
@ -1,6 +1,8 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
readonly BASEDIR=$(readlink -f $(dirname $0))/..
|
readonly BASEDIR=$(readlink -f $(dirname $0))/..
|
||||||
|
source "$BASEDIR/scripts/common.sh"
|
||||||
|
|
||||||
cd $BASEDIR
|
cd $BASEDIR
|
||||||
|
|
||||||
# exit on errors
|
# exit on errors
|
||||||
@ -492,7 +494,13 @@ SC2119,SC2120,SC2148,SC2153,SC2154,SC2164,SC2174,SC2001,SC2206,SC2207,SC2223"
|
|||||||
|
|
||||||
SHCK_FORMAT="tty"
|
SHCK_FORMAT="tty"
|
||||||
SHCK_APPLY=false
|
SHCK_APPLY=false
|
||||||
SHCH_ARGS=" -x -e $SHCK_EXCLUDE -f $SHCK_FORMAT"
|
SHCH_ARGS="-e $SHCK_EXCLUDE -f $SHCK_FORMAT"
|
||||||
|
|
||||||
|
if ge "$shellcheck_v" 0.4.0; then
|
||||||
|
SHCH_ARGS+=" -x"
|
||||||
|
else
|
||||||
|
echo "shellcheck $shellcheck_v detected, recommended >= 0.4.0."
|
||||||
|
fi
|
||||||
|
|
||||||
get_bash_files | xargs -P$(nproc) -n1 shellcheck $SHCH_ARGS &> shellcheck.log
|
get_bash_files | xargs -P$(nproc) -n1 shellcheck $SHCH_ARGS &> shellcheck.log
|
||||||
if [[ -s shellcheck.log ]]; then
|
if [[ -s shellcheck.log ]]; then
|
||||||
|
Loading…
Reference in New Issue
Block a user