Disable shellcheck in the remaining situations where it's either wrong or the problem is not worth fixing

This commit is contained in:
Kamil Śliwak 2020-12-11 18:28:19 +01:00
parent 008d648af3
commit 8e44b59251
5 changed files with 14 additions and 0 deletions

View File

@ -48,6 +48,7 @@ TMPDIR=$(mktemp -d)
cp "$REPO_ROOT/emscripten_build/libsolc/soljson.js" solc-js/
cp "$REPO_ROOT/scripts/bytecodecompare/prepare_report.js" .
echo "Running the compiler..."
# shellcheck disable=SC2035
./prepare_report.js *.sol > report.txt
echo "Finished running the compiler."
else

View File

@ -40,7 +40,9 @@ function versionGreater()
{
v1=$1
v2=$2
# shellcheck disable=SC2206
ver1=( ${v1//./ } )
# shellcheck disable=SC2206
ver2=( ${v2//./ } )
if (( "${ver1[0]}" > "${ver2[0]}" ))

View File

@ -175,6 +175,7 @@ case $(uname -s) in
Debian*|Raspbian)
#Debian
# shellcheck disable=SC1091
. /etc/os-release
install_z3=""
case $VERSION_ID in
@ -354,7 +355,10 @@ case $(uname -s) in
#------------------------------------------------------------------------------
CentOS*)
echo "Attention: CentOS 7 is currently not supported!";
# FIXME: read -p and [[ ]] are bash features but our shebang says we're using sh
# shellcheck disable=SC2039
read -p "This script will heavily modify your system in order to allow for compilation of Solidity. Are you sure? [Y/N]" -n 1 -r
# shellcheck disable=SC2039
if [[ $REPLY =~ ^[Yy]$ ]]; then
# Make Sure we have the EPEL repos
sudo yum -y install epel-release

View File

@ -190,6 +190,7 @@ echo "Extract bytecode comparison scripts from v0.6.1..."
cd /root/project
git checkout v0.6.1 --quiet
cp scripts/bytecodecompare/storebytecode.sh /tmp
# shellcheck disable=SC2016
sed -i -e 's/rm -rf "\$TMPDIR"/cp "\$TMPDIR"\/report.txt \/tmp\/report.txt ; rm -rf "\$TMPDIR"/' /tmp/storebytecode.sh
sed -i -e 's/REPO_ROOT=.*/REPO_ROOT=\/src/' /tmp/storebytecode.sh
export SOLC_EMSCRIPTEN="On"

View File

@ -126,6 +126,7 @@ function test_solc_behaviour()
local stdout_path; stdout_path=$(mktemp)
local stderr_path; stderr_path=$(mktemp)
# shellcheck disable=SC2064
trap "rm -f $stdout_path $stderr_path" EXIT
if [[ "$exit_code_expected" = "" ]]; then exit_code_expected="0"; fi
@ -146,10 +147,13 @@ function test_solc_behaviour()
# Remove bytecode (but not linker references).
sed -i.bak -E -e 's/(\"object\":\")[0-9a-f]+([^"]*\")/\1<BYTECODE REMOVED>\2/g' "$stdout_path"
# shellcheck disable=SC2016
sed -i.bak -E -e 's/(\"object\":\"[^"]+\$__)[0-9a-f]+(\")/\1<BYTECODE REMOVED>\2/g' "$stdout_path"
# shellcheck disable=SC2016
sed -i.bak -E -e 's/([0-9a-f]{34}\$__)[0-9a-f]+(__\$[0-9a-f]{17})/\1<BYTECODE REMOVED>\2/g' "$stdout_path"
# Replace escaped newlines by actual newlines for readability
# shellcheck disable=SC1003
sed -i.bak -E -e 's/\\n/\'$'\n/g' "$stdout_path"
rm "$stdout_path.bak"
else
@ -166,7 +170,9 @@ function test_solc_behaviour()
# 64697066735822 = hex encoding of 0x64 'i' 'p' 'f' 's' 0x58 0x22
# 64736f6c63 = hex encoding of 0x64 's' 'o' 'l' 'c'
sed -i.bak -E -e 's/[0-9a-f]*64697066735822[0-9a-f]+64736f6c63[0-9a-f]+/<BYTECODE REMOVED>/g' "$stdout_path"
# shellcheck disable=SC2016
sed -i.bak -E -e 's/([0-9a-f]{17}\$__)[0-9a-f]+(__\$[0-9a-f]{17})/\1<BYTECODE REMOVED>\2/g' "$stdout_path"
# shellcheck disable=SC2016
sed -i.bak -E -e 's/[0-9a-f]+((__\$[0-9a-f]{34}\$__)*<BYTECODE REMOVED>)/<BYTECODE REMOVED>\1/g' "$stdout_path"
# Remove trailing empty lines. Needs a line break to make OSX sed happy.