diff --git a/scripts/bytecodecompare/storebytecode.sh b/scripts/bytecodecompare/storebytecode.sh index 72a834eee..9298dd4d3 100755 --- a/scripts/bytecodecompare/storebytecode.sh +++ b/scripts/bytecodecompare/storebytecode.sh @@ -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 diff --git a/scripts/docs_version_pragma_check.sh b/scripts/docs_version_pragma_check.sh index 77aa4ee73..8ffd0afb6 100755 --- a/scripts/docs_version_pragma_check.sh +++ b/scripts/docs_version_pragma_check.sh @@ -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]}" )) diff --git a/scripts/install_deps.sh b/scripts/install_deps.sh index ee7aab549..d7b7b29cb 100755 --- a/scripts/install_deps.sh +++ b/scripts/install_deps.sh @@ -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 diff --git a/scripts/wasm-rebuild/docker-scripts/rebuild_tags.sh b/scripts/wasm-rebuild/docker-scripts/rebuild_tags.sh index 05ada07f3..18c922c06 100755 --- a/scripts/wasm-rebuild/docker-scripts/rebuild_tags.sh +++ b/scripts/wasm-rebuild/docker-scripts/rebuild_tags.sh @@ -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" diff --git a/test/cmdlineTests.sh b/test/cmdlineTests.sh index 26230c965..95c913989 100755 --- a/test/cmdlineTests.sh +++ b/test/cmdlineTests.sh @@ -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\2/g' "$stdout_path" + # shellcheck disable=SC2016 sed -i.bak -E -e 's/(\"object\":\"[^"]+\$__)[0-9a-f]+(\")/\1\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\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]+//g' "$stdout_path" + # shellcheck disable=SC2016 sed -i.bak -E -e 's/([0-9a-f]{17}\$__)[0-9a-f]+(__\$[0-9a-f]{17})/\1\2/g' "$stdout_path" + # shellcheck disable=SC2016 sed -i.bak -E -e 's/[0-9a-f]+((__\$[0-9a-f]{34}\$__)*)/\1/g' "$stdout_path" # Remove trailing empty lines. Needs a line break to make OSX sed happy.