From 6c2747491d7840413caa393cc0f1be0c22b9e94b Mon Sep 17 00:00:00 2001 From: Maciej Wawryk Date: Mon, 16 Dec 2019 17:56:51 +0100 Subject: [PATCH] Shellcheck - ignore SC2034 warnings Add to pernamently excluded in shellcheck: SC2034: foo appears unused. Verify it or export it. Signed-off-by: Maciej Wawryk Change-Id: Ib63edb8cdf8ec718981d28d5acec75772b825a48 Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/478102 Tested-by: SPDK CI Jenkins Reviewed-by: Paul Luse Reviewed-by: Jim Harris Reviewed-by: Shuhei Matsumoto --- scripts/check_format.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/check_format.sh b/scripts/check_format.sh index 5c85c3d2f..bd9b6a711 100755 --- a/scripts/check_format.sh +++ b/scripts/check_format.sh @@ -240,7 +240,7 @@ if hash shellcheck 2>/dev/null; then # go to: https://trello.com/c/29Z90j1W # Error descriptions can also be found at: https://github.com/koalaman/shellcheck/wiki # This SHCK_EXCLUDE list is out "to do" and we work to fix all of this errors. - SHCK_EXCLUDE="SC2002,SC2010,SC2034" + SHCK_EXCLUDE="SC2002,SC2010" # SPDK fails some error checks which have been deprecated in later versions of shellcheck. # We will not try to fix these error checks, but instead just leave the error types here # so that we can still run with older versions of shellcheck. @@ -253,6 +253,7 @@ if hash shellcheck 2>/dev/null; then # SC2001: See if you can use ${variable//search/replace} instead. # SC2015: Note that A && B || C is not if-then-else. C may run when A is true. # SC2016: Expressions don't expand in single quotes, use double quotes for that. + # SC2034: foo appears unused. Verify it or export it. # SC2046: Quote this to prevent word splitting. # SC2086: Double quote to prevent globbing and word splitting. # SC2119: Use foo "$@" if function's $1 should mean script's $1. @@ -266,8 +267,8 @@ if hash shellcheck 2>/dev/null; then # or split robustly with mapfile or read -a. # SC2207: Prefer mapfile or read -a to split command output (or quote to avoid splitting). # SC2223: This default assignment may cause DoS due to globbing. Quote it. - SHCK_EXCLUDE="$SHCK_EXCLUDE,SC1083,SC1090,SC1091,SC2015,SC2016,SC2046,SC2086,SC2119,SC2120,SC2148,\ -SC2153,SC2154,SC2164,SC2174,SC2001,SC2206,SC2207,SC2223" + SHCK_EXCLUDE="$SHCK_EXCLUDE,SC1083,SC1090,SC1091,SC2015,SC2016,SC2034,SC2046,SC2086,SC2119,SC2120,\ +SC2148,SC2153,SC2154,SC2164,SC2174,SC2001,SC2206,SC2207,SC2223" SHCK_FORMAT="diff" SHCK_APPLY=true