Skip to content

Commit

Permalink
chore: fix shellcheck styles, add shellcheckrc
Browse files Browse the repository at this point in the history
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
  • Loading branch information
mds1 committed Dec 12, 2023
1 parent 1b0f606 commit 36422c0
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 11 deletions.
1 change: 1 addition & 0 deletions .shellcheckrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
disable=SC2002
4 changes: 2 additions & 2 deletions indexer/ui/prisma.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ function check_prisma() {
echo "Checking Prisma Schema..."
cp "$PRISMA_FILE" "$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."
rm "$TEMP_FILE"
else
Expand Down
4 changes: 2 additions & 2 deletions op-challenger/scripts/alphabet/charlie.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
set -euo pipefail

SOURCE_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
CHALLENGER_DIR=$(echo "${SOURCE_DIR%/*/*}")
MONOREPO_DIR=$(echo "${SOURCE_DIR%/*/*/*}")
CHALLENGER_DIR=$("${SOURCE_DIR%/*/*}")
MONOREPO_DIR=$("${SOURCE_DIR%/*/*/*}")

# Check that the fault game address file exists
FAULT_GAME_ADDR_FILE="$CHALLENGER_DIR/.fault-game-address"
Expand Down
4 changes: 2 additions & 2 deletions op-challenger/scripts/alphabet/init_game.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
set -euo pipefail

SOURCE_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
CHALLENGER_DIR=$(echo "${SOURCE_DIR%/*/*}")
MONOREPO_DIR=$(echo "${SOURCE_DIR%/*/*/*}")
CHALLENGER_DIR="${SOURCE_DIR%/*/*}"
MONOREPO_DIR="${SOURCE_DIR%/*/*/*}"

cd "$CHALLENGER_DIR"
make
Expand Down
4 changes: 2 additions & 2 deletions op-challenger/scripts/alphabet/mallory.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
set -euo pipefail

SOURCE_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
CHALLENGER_DIR=$(echo "${SOURCE_DIR%/*/*}")
MONOREPO_DIR=$(echo "${SOURCE_DIR%/*/*/*}")
CHALLENGER_DIR=$("${SOURCE_DIR%/*/*}")
MONOREPO_DIR=$("${SOURCE_DIR%/*/*/*}")

# Check that the fault game address file exists
FAULT_GAME_ADDR_FILE="$CHALLENGER_DIR/.fault-game-address"
Expand Down
2 changes: 1 addition & 1 deletion op-challenger/scripts/visualize.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ RPC="${1:?Must specify RPC address}"
FAULT_GAME_ADDRESS="${2:?Must specify game address}"

DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
DIR=$(echo "${DIR%/*/*}")
DIR="${DIR%/*/*}"
cd "$DIR"/packages/contracts-bedrock

forge script scripts/FaultDisputeGameViz.s.sol \
Expand Down
2 changes: 1 addition & 1 deletion packages/contracts-bedrock/scripts/generate-l2-genesis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ cleanup() {
wait_l2_outfile() {
i=1
while [ $i -le "$2" ]; do
i=$(($i + 1))
i=$((i + 1))

if [ ! -f "$OUTFILE_L2" ]; then
sleep "$1"
Expand Down
2 changes: 1 addition & 1 deletion packages/contracts-bedrock/scripts/slither.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ fi
# 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.
# 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"
SLITHER_OUTPUT=$(slither . --triage-mode --json $SLITHER_REPORT || true)

Expand Down

0 comments on commit 36422c0

Please sign in to comment.