Skip to content

Commit 908a559

Browse files
macOS fix: Add excludes for checks added in the newer shellcheck version installed by brew
1 parent ec4d57b commit 908a559

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

test/lint/lint-shell.sh

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,14 @@ if [ "$TRAVIS" = "true" ]; then
1616
unset LC_ALL
1717
fi
1818

19+
if ! command -v shellcheck > /dev/null; then
20+
echo "Skipping shell linting since shellcheck is not installed."
21+
exit 0
22+
fi
23+
1924
# Disabled warnings:
25+
# SC1087: Use braces when expanding arrays, e.g. ${array[idx]} (or ${var}[.. to quiet).
26+
# SC1117: Backslash is literal in "\.". Prefer explicit escaping: "\\.".
2027
# SC2001: See if you can use ${variable//search/replace} instead.
2128
# SC2004: $/${} is unnecessary on arithmetic variables.
2229
# SC2005: Useless echo? Instead of 'echo $(cmd)', just use 'cmd'.
@@ -33,5 +40,8 @@ fi
3340
# SC2166: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined.
3441
# SC2166: Prefer [ p ] || [ q ] as [ p -o q ] is not well defined.
3542
# SC2181: Check exit code directly with e.g. 'if mycmd;', not indirectly with $?.
36-
shellcheck -e SC2001,SC2004,SC2005,SC2006,SC2016,SC2028,SC2046,SC2048,SC2066,SC2086,SC2116,SC2148,SC2162,SC2166,SC2181 \
43+
# SC2206: Quote to prevent word splitting, or split robustly with mapfile or read -a.
44+
# SC2207: Prefer mapfile or read -a to split command output (or quote to avoid splitting).
45+
# SC2230: which is non-standard. Use builtin 'command -v' instead.
46+
shellcheck -e SC1087,SC1117,SC2001,SC2004,SC2005,SC2006,SC2016,SC2028,SC2046,SC2048,SC2066,SC2086,SC2116,SC2148,SC2162,SC2166,SC2181,SC2206,SC2207,SC2230 \
3747
$(git ls-files -- "*.sh" | grep -vE 'src/(secp256k1|univalue)/')

0 commit comments

Comments
 (0)