Commit fd73cb78 authored by Seth Howell's avatar Seth Howell Committed by Tomasz Zawadzki
Browse files

check_format: add SC2015 to SHCK_EXCLUDE list.



This shellcheck case warns users when they use the pattern A && B || C
so that they don't accidentally try to use it as an if-then-else
statement. However, there is a valid way of using this pattern to
denote, do A, if it succeeds, do B, if either A or B fails, do C.

Change-Id: I283b433c15d07873befd182e8327f2e0602490aa
Signed-off-by: default avatarSeth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/476960


Community-CI: SPDK CI Jenkins <sys_sgci@intel.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarPaul Luse <paul.e.luse@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: default avatarKarol Latecki <karol.latecki@intel.com>
parent 64569ea5
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -250,6 +250,7 @@ if hash shellcheck 2>/dev/null; then
	# 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.
	# 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.
	# SC2119: Use foo "$@" if function's $1 should mean script's $1.
	# SC2120: foo references arguments, but none are ever passed.
@@ -262,7 +263,7 @@ 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,SC1090,SC1091,SC2016,SC2119,SC2120,SC2148,SC2153,SC2154,SC2164,\
	SHCK_EXCLUDE="$SHCK_EXCLUDE,SC1090,SC1091,SC2015,SC2016,SC2119,SC2120,SC2148,SC2153,SC2154,SC2164,\
SC2174,SC2001,SC2206,SC2207,SC2223"

	SHCK_FORMAT="diff"