Commit 36422c0a authored by Matt Solomon's avatar Matt Solomon

chore: fix shellcheck styles, add shellcheckrc

we add the shellcheckrc to ignore useless cat: https://www.shellcheck.net/wiki/SC2002
since that is a purely stylistic choice that does not
affect correctness and is easy to read/understand
parent 1b0f606a
disable=SC2002
...@@ -18,8 +18,8 @@ function check_prisma() { ...@@ -18,8 +18,8 @@ function check_prisma() {
echo "Checking Prisma Schema..." echo "Checking Prisma Schema..."
cp "$PRISMA_FILE" "$TEMP_FILE" cp "$PRISMA_FILE" "$TEMP_FILE"
npx prisma db pull --url "$DATABASE_URL" --schema "$TEMP_FILE" npx prisma db pull --url "$DATABASE_URL" --schema "$TEMP_FILE"
diff "$PRISMA_FILE" "$TEMP_FILE" > /dev/null
if [ $? -eq 0 ]; then if diff "$PRISMA_FILE" "$TEMP_FILE" > /dev/null; then
echo "Prisma Schema is up-to-date." echo "Prisma Schema is up-to-date."
rm "$TEMP_FILE" rm "$TEMP_FILE"
else else
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
set -euo pipefail set -euo pipefail
SOURCE_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) SOURCE_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
CHALLENGER_DIR=$(echo "${SOURCE_DIR%/*/*}") CHALLENGER_DIR=$("${SOURCE_DIR%/*/*}")
MONOREPO_DIR=$(echo "${SOURCE_DIR%/*/*/*}") MONOREPO_DIR=$("${SOURCE_DIR%/*/*/*}")
# Check that the fault game address file exists # Check that the fault game address file exists
FAULT_GAME_ADDR_FILE="$CHALLENGER_DIR/.fault-game-address" FAULT_GAME_ADDR_FILE="$CHALLENGER_DIR/.fault-game-address"
......
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
set -euo pipefail set -euo pipefail
SOURCE_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) SOURCE_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
CHALLENGER_DIR=$(echo "${SOURCE_DIR%/*/*}") CHALLENGER_DIR="${SOURCE_DIR%/*/*}"
MONOREPO_DIR=$(echo "${SOURCE_DIR%/*/*/*}") MONOREPO_DIR="${SOURCE_DIR%/*/*/*}"
cd "$CHALLENGER_DIR" cd "$CHALLENGER_DIR"
make make
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
set -euo pipefail set -euo pipefail
SOURCE_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) SOURCE_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
CHALLENGER_DIR=$(echo "${SOURCE_DIR%/*/*}") CHALLENGER_DIR=$("${SOURCE_DIR%/*/*}")
MONOREPO_DIR=$(echo "${SOURCE_DIR%/*/*/*}") MONOREPO_DIR=$("${SOURCE_DIR%/*/*/*}")
# Check that the fault game address file exists # Check that the fault game address file exists
FAULT_GAME_ADDR_FILE="$CHALLENGER_DIR/.fault-game-address" FAULT_GAME_ADDR_FILE="$CHALLENGER_DIR/.fault-game-address"
......
...@@ -6,7 +6,7 @@ RPC="${1:?Must specify RPC address}" ...@@ -6,7 +6,7 @@ RPC="${1:?Must specify RPC address}"
FAULT_GAME_ADDRESS="${2:?Must specify game address}" FAULT_GAME_ADDRESS="${2:?Must specify game address}"
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
DIR=$(echo "${DIR%/*/*}") DIR="${DIR%/*/*}"
cd "$DIR"/packages/contracts-bedrock cd "$DIR"/packages/contracts-bedrock
forge script scripts/FaultDisputeGameViz.s.sol \ forge script scripts/FaultDisputeGameViz.s.sol \
......
...@@ -31,7 +31,7 @@ cleanup() { ...@@ -31,7 +31,7 @@ cleanup() {
wait_l2_outfile() { wait_l2_outfile() {
i=1 i=1
while [ $i -le "$2" ]; do while [ $i -le "$2" ]; do
i=$(($i + 1)) i=$((i + 1))
if [ ! -f "$OUTFILE_L2" ]; then if [ ! -f "$OUTFILE_L2" ]; then
sleep "$1" sleep "$1"
......
...@@ -57,7 +57,7 @@ fi ...@@ -57,7 +57,7 @@ fi
# Findings to keep are output to the slither-report.json output file. # Findings to keep are output to the slither-report.json output file.
# Checking in a json file is cleaner than adding slither-disable comments throughout the codebase. # Checking in a json file is cleaner than adding slither-disable comments throughout the codebase.
# See slither.config.json for slither settings and to disable specific detectors. # See slither.config.json for slither settings and to disable specific detectors.
if [[ ! -z "$TRIAGE_MODE" ]]; then if [[ -n "$TRIAGE_MODE" ]]; then
echo "Running slither in triage mode" echo "Running slither in triage mode"
SLITHER_OUTPUT=$(slither . --triage-mode --json $SLITHER_REPORT || true) SLITHER_OUTPUT=$(slither . --triage-mode --json $SLITHER_REPORT || true)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment