From 27ef3373a6772deca4238afebecd930abee6a723 Mon Sep 17 00:00:00 2001 From: Maciej Wawryk Date: Wed, 23 Oct 2019 15:13:42 +0200 Subject: [PATCH] test: Shellcheck - ignore SC2164 warnings Add to permanently excluded in shellcheck: SC2164: Use cd ... || exit in case cd fails. Signed-off-by: Maciej Wawryk Change-Id: Ic8091de0cdc7bba441ea1715699ca5bd170ece59 Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/472176 Tested-by: SPDK CI Jenkins Reviewed-by: Jim Harris Reviewed-by: Shuhei Matsumoto --- scripts/check_format.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/check_format.sh b/scripts/check_format.sh index 544bf3bed..157633eda 100755 --- a/scripts/check_format.sh +++ b/scripts/check_format.sh @@ -244,7 +244,7 @@ if hash shellcheck 2>/dev/null; then SC2010,SC2012,SC2016,SC2034,SC2045,SC2046,SC2068,SC2086,SC2089,SC2090,\ SC2097,SC2098,SC2119,SC2120,SC2121,SC2124,SC2126,SC2128,\ SC2129,SC2140,SC2142,SC2143,SC2148,SC2152,SC2153,SC2154,SC2155,\ -SC2162,SC2164" +SC2162" # 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. @@ -254,12 +254,13 @@ SC2162,SC2164" # SC1090: Can't follow non-constant source. Use a directive to specify location. # SC1091: Not following: (error message here) # SC2001: See if you can use ${variable//search/replace} instead. + # SC2164: Use cd ... || exit in case cd fails. # SC2174: When used with -p, -m only applies to the deepest directory. # SC2206: Quote to prevent word splitting/globbing, # 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,SC1090,SC1091,SC2174,SC2001,SC2206,SC2207,SC2223" + SHCK_EXCLUDE="$SHCK_EXCLUDE,SC1090,SC1091,SC2164,SC2174,SC2001,SC2206,SC2207,SC2223" SHCK_FORMAT="diff" SHCK_APPLY=true