From a52f4b1f30483527a71c803f6540ab33485ca299 Mon Sep 17 00:00:00 2001 From: David Spickett Date: Mon, 6 Apr 2020 15:31:12 +0100 Subject: sanity-check.sh: Ignore Style and Info warnings Later versions of shellcheck can ignore by level but our version in docker cannot. So emulating that with a list. (may go back and fix these too at some point) Change-Id: I406ccd23a8894b32e70373bb148a964cb2f43a98 --- sanity-check.sh | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'sanity-check.sh') diff --git a/sanity-check.sh b/sanity-check.sh index 18445694..bfbd5d51 100755 --- a/sanity-check.sh +++ b/sanity-check.sh @@ -1,4 +1,21 @@ #!/bin/bash set -eu -o pipefail -shellcheck "$(dirname "$0")"/*.sh +#TODO: newer versions of shellcheck can set a minimum message level +ignored=( +# All STYLE warnings seen so far +-e SC2001 # See if you can use ${variable//search/replace} instead. +-e SC2002 # Useless cat. Consider 'cmd < file | ..' or 'cmd file | ..' instead. +-e SC2004 # $/${} is unnecessary on arithmetic variables. +-e SC2006 # Use $(..) instead of legacy `..`. +# All INFO warnings seen so far +-e SC2016 # Expressions don't expand in single quotes, use double quotes for that. +-e SC2086 # Double quote to prevent globbing and word splitting. +-e SC2102 # Ranges can only match single chars (mentioned due to duplicates). +-e SC2094 # Make sure not to read and write the same file in the same pipeline. +-e SC2029 # Note that, unescaped, this expands on the client side. +-e SC2030 # Modification of PATH is local (to subshell caused by (..) group). +-e SC2031 # baseline_branch was modified in a subshell. That change might be lost. +) + +shellcheck "$(dirname "$0")"/*.sh "${ignored[@]}" -- cgit v1.2.3