Merge #15166: qa: Pin shellcheck version

a517541794 Remove no longer needed shellcheck suppressions (practicalswift)
0b7196ecad Fix warnings introduced in shellcheck v0.6.0 (practicalswift)
07a53dce9f Remove repeated suppression. Fix indentation. (practicalswift)
638e53b472 Pin shellcheck version to v0.6.0 (practicalswift)

Pull request description:

  Pin `shellcheck` version.

Tree-SHA512: 996e438e424020fe888de1d77ffd33fa32848332febfffbc21a842784aee339332c79c41687c9c577ba1206eb20674623157d584a072e8ae88ae086ee2277bc8
This commit is contained in:
MarcoFalke 2019-01-17 10:55:46 -05:00
commit 12b30105fc
No known key found for this signature in database
GPG key ID: D2EA4850E7528B25
4 changed files with 21 additions and 20 deletions

View file

@ -9,3 +9,7 @@ export LC_ALL=C
travis_retry pip install codespell==1.13.0
travis_retry pip install flake8==3.5.0
travis_retry pip install vulture==0.29
SHELLCHECK_VERSION=v0.6.0
curl -s "https://storage.googleapis.com/shellcheck/shellcheck-${SHELLCHECK_VERSION}.linux.x86_64.tar.xz" | tar --xz -xf - --directory /tmp/
export PATH="/tmp/shellcheck-${SHELLCHECK_VERSION}:${PATH}"

View file

@ -11,20 +11,20 @@
export LC_ALL=C
FUNCTION_NAMES_AND_NUMBER_OF_LEADING_ARGUMENTS=(
FatalError,0
fprintf,1
LogConnectFailure,1
LogPrint,1
LogPrintf,0
printf,0
snprintf,2
sprintf,1
strprintf,0
vfprintf,1
vprintf,1
vsnprintf,1
vsprintf,1
WalletLogPrintf,0
"FatalError,0"
"fprintf,1"
"LogConnectFailure,1"
"LogPrint,1"
"LogPrintf,0"
"printf,0"
"snprintf,2"
"sprintf,1"
"strprintf,0"
"vfprintf,1"
"vprintf,1"
"vsnprintf,1"
"vsprintf,1"
"WalletLogPrintf,0"
)
EXIT_CODE=0

View file

@ -13,7 +13,7 @@ export LC_ALL=C
# respectively. So export LC_ALL=C is set as required by lint-shell-locale.sh
# but unset here in case of running in Travis.
if [ "$TRAVIS" = "true" ]; then
unset LC_ALL
unset LC_ALL
fi
if ! command -v shellcheck > /dev/null; then
@ -24,7 +24,6 @@ fi
# Disabled warnings:
disabled=(
SC1087 # Use braces when expanding arrays, e.g. ${array[idx]} (or ${var}[.. to quiet).
SC1117 # Backslash is literal in "\.". Prefer explicit escaping: "\\.".
SC2001 # See if you can use ${variable//search/replace} instead.
SC2004 # $/${} is unnecessary on arithmetic variables.
SC2005 # Useless echo? Instead of 'echo $(cmd)', just use 'cmd'.
@ -36,10 +35,8 @@ disabled=(
SC2066 # Since you double quoted this, it will not word split, and the loop will only run once.
SC2086 # Double quote to prevent globbing and word splitting.
SC2116 # Useless echo? Instead of 'cmd $(echo foo)', just use 'cmd foo'.
SC2148 # Tips depend on target shell and yours is unknown. Add a shebang.
SC2162 # read without -r will mangle backslashes.
SC2166 # Prefer [ p ] && [ q ] as [ p -a q ] is not well defined.
SC2166 # Prefer [ p ] || [ q ] as [ p -o q ] is not well defined.
SC2166 # Prefer [ p ] {&&,||} [ q ] as [ p -{a,o} q ] is not well defined.
SC2181 # Check exit code directly with e.g. 'if mycmd;', not indirectly with $?.
SC2206 # Quote to prevent word splitting, or split robustly with mapfile or read -a.
SC2207 # Prefer mapfile or read -a to split command output (or quote to avoid splitting).

View file

@ -23,7 +23,7 @@ while getopts "?" opt; do
done
if [ -z "${TRAVIS_COMMIT_RANGE}" ]; then
if [ "$1" ]; then
if [ -n "$1" ]; then
TRAVIS_COMMIT_RANGE="HEAD~$1...HEAD"
else
TRAVIS_COMMIT_RANGE="HEAD"