mirror of
https://github.com/bitcoin/bitcoin.git
synced 2024-11-20 02:25:40 +01:00
1ac454a384
Enabled ShellCheck rules: SC1087 SC2001 SC2004 SC2005 SC2006 SC2016 SC2028 SC2048 SC2066 (note that IFS already contains only a line feed) SC2116 SC2166 SC2181 SC2206 SC2207 SC2230 SC2236
32 lines
1.0 KiB
Bash
Executable File
32 lines
1.0 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
#
|
|
# Copyright (c) 2018 The Bitcoin Core developers
|
|
# Distributed under the MIT software license, see the accompanying
|
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
|
#
|
|
# Check for shellcheck warnings in shell scripts.
|
|
|
|
export LC_ALL=C
|
|
|
|
# The shellcheck binary segfault/coredumps in Travis with LC_ALL=C
|
|
# It does not do so in Ubuntu 14.04, 16.04, 18.04 in versions 0.3.3, 0.3.7, 0.4.6
|
|
# 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
|
|
fi
|
|
|
|
if ! command -v shellcheck > /dev/null; then
|
|
echo "Skipping shell linting since shellcheck is not installed."
|
|
exit 0
|
|
fi
|
|
|
|
# Disabled warnings:
|
|
disabled=(
|
|
SC2046 # Quote this to prevent word splitting.
|
|
SC2086 # Double quote to prevent globbing and word splitting.
|
|
SC2162 # read without -r will mangle backslashes.
|
|
)
|
|
shellcheck -e "$(IFS=","; echo "${disabled[*]}")" \
|
|
$(git ls-files -- "*.sh" | grep -vE 'src/(secp256k1|univalue)/')
|