[Intel-gfx] [maintainer-tools PATCH 27/30] qf: SC2153 - Fix another shellcheck complain.

Rodrigo Vivi rodrigo.vivi at intel.com
Mon Aug 21 20:11:17 UTC 2017


^-- SC2153: Possible misspelling: BASELINE may not be assigned, but baseline is.

BASELINE is defined inside patches/config, but this confuses shellcheck.
According to https://github.com/koalaman/shellcheck/wiki/SC2153
the message doesn't appear for guarded references where if variable
is defined a default is used.

Maybe we should pick a better default like the git HEAD ?!

Cc: Jani Nikula <jani.nikula at intel.com>
Cc: Daniel Vetter <daniel.vetter at ffwll.ch>
Cc: Joonas Lahtinen <joonas.lahtinen at linux.intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi at intel.com>
---
 qf | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/qf b/qf
index 059c8e5afe1d..a42ef4779cab 100755
--- a/qf
+++ b/qf
@@ -85,7 +85,7 @@ function repo_check # allow-detached
 	fi
 
 	# shellcheck source=/dev/null
-	baseline=$(source patches/config ; echo $BASELINE)
+	baseline=$(source patches/config ; echo ${BASELINE:-})
 
 	if [[ $(git rev-parse HEAD) != "$baseline" ]] ; then
 		echo Baseline commit doesn\'t match with quilt config
@@ -233,7 +233,7 @@ function qf_checkout
 	# error code 2 means no patches removed, which is ok
 	quiet_pop_all -f
 	# shellcheck source=/dev/null
-	baseline=$(source patches/config ; echo $BASELINE)
+	baseline=$(source patches/config ; echo ${BASELINE:-})
 	checkout_baseline
 	quilt push -a -q > /dev/null
 	echo Now at $(quilt top)
-- 
2.13.2



More information about the Intel-gfx mailing list