summaryrefslogtreecommitdiff
path: root/sanity-check.sh
diff options
context:
space:
mode:
authorDavid Spickett <david.spickett@linaro.org>2020-04-06 15:31:12 +0100
committerDavid Spickett <david.spickett@linaro.org>2020-04-15 10:18:55 +0000
commita52f4b1f30483527a71c803f6540ab33485ca299 (patch)
tree713674ceac51153380ad7170e7ff453280f3819a /sanity-check.sh
parent6a6a44f8c4f75bf66a80af0a6b5f4b6aed6a3a3e (diff)
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
Diffstat (limited to 'sanity-check.sh')
-rwxr-xr-xsanity-check.sh19
1 files changed, 18 insertions, 1 deletions
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[@]}"