From 0ee7697e4debb0c37942d180dafa0a512594a70c Mon Sep 17 00:00:00 2001 From: Ben Walker Date: Fri, 4 Sep 2020 15:49:42 -0700 Subject: [PATCH] scripts: Always use tty mode for shellcheck Even on version 0.7.0, the diff mode throws up a bunch of errors that don't appear in the tty mode. We'll have to deal with those at a later date. Signed-off-by: Ben Walker Change-Id: Ic7001b9cf793e696bbf4bab0b0630e8d705a6905 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4071 Tested-by: SPDK CI Jenkins Reviewed-by: Paul Luse Reviewed-by: Shuhei Matsumoto Reviewed-by: Tomasz Zawadzki Reviewed-by: Jim Harris --- scripts/check_format.sh | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/scripts/check_format.sh b/scripts/check_format.sh index f4df5c41b..73c4ff67f 100755 --- a/scripts/check_format.sh +++ b/scripts/check_format.sh @@ -424,12 +424,8 @@ if hash shellcheck 2> /dev/null; then SHCK_EXCLUDE="$SHCK_EXCLUDE,SC1083,SC1090,SC1091,SC2010,SC2015,SC2016,SC2034,SC2046,SC2086,\ SC2119,SC2120,SC2148,SC2153,SC2154,SC2164,SC2174,SC2001,SC2206,SC2207,SC2223" - SHCK_FORMAT="diff" - SHCK_APPLY=true - if [ "$shellcheck_v" \< "0.7.0" ]; then - SHCK_FORMAT="tty" - SHCK_APPLY=false - fi + SHCK_FORMAT="tty" + SHCK_APPLY=false SHCH_ARGS=" -x -e $SHCK_EXCLUDE -f $SHCK_FORMAT" error=0 @@ -437,14 +433,6 @@ SC2119,SC2120,SC2148,SC2153,SC2154,SC2164,SC2174,SC2001,SC2206,SC2207,SC2223" if [ $error -ne 0 ]; then echo " Bash formatting errors detected!" - # Some errors are not auto-fixable. Fall back to tty output. - if grep -q "Use another format to see them." shellcheck.log; then - SHCK_FORMAT="tty" - SHCK_APPLY=false - SHCH_ARGS=" -e $SHCK_EXCLUDE -f $SHCK_FORMAT" - git ls-files '*.sh' | xargs -P$(nproc) -n1 shellcheck $SHCH_ARGS > shellcheck.log || error=1 - fi - cat shellcheck.log if $SHCK_APPLY; then git apply shellcheck.log