Skip to content

Commit 36422c0

Browse files
committed
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
1 parent 1b0f606 commit 36422c0

File tree

8 files changed

+12
-11
lines changed

8 files changed

+12
-11
lines changed

.shellcheckrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
disable=SC2002

indexer/ui/prisma.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ function check_prisma() {
1818
echo "Checking Prisma Schema..."
1919
cp "$PRISMA_FILE" "$TEMP_FILE"
2020
npx prisma db pull --url "$DATABASE_URL" --schema "$TEMP_FILE"
21-
diff "$PRISMA_FILE" "$TEMP_FILE" > /dev/null
22-
if [ $? -eq 0 ]; then
21+
22+
if diff "$PRISMA_FILE" "$TEMP_FILE" > /dev/null; then
2323
echo "Prisma Schema is up-to-date."
2424
rm "$TEMP_FILE"
2525
else

op-challenger/scripts/alphabet/charlie.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
set -euo pipefail
33

44
SOURCE_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
5-
CHALLENGER_DIR=$(echo "${SOURCE_DIR%/*/*}")
6-
MONOREPO_DIR=$(echo "${SOURCE_DIR%/*/*/*}")
5+
CHALLENGER_DIR=$("${SOURCE_DIR%/*/*}")
6+
MONOREPO_DIR=$("${SOURCE_DIR%/*/*/*}")
77

88
# Check that the fault game address file exists
99
FAULT_GAME_ADDR_FILE="$CHALLENGER_DIR/.fault-game-address"

op-challenger/scripts/alphabet/init_game.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
set -euo pipefail
44

55
SOURCE_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
6-
CHALLENGER_DIR=$(echo "${SOURCE_DIR%/*/*}")
7-
MONOREPO_DIR=$(echo "${SOURCE_DIR%/*/*/*}")
6+
CHALLENGER_DIR="${SOURCE_DIR%/*/*}"
7+
MONOREPO_DIR="${SOURCE_DIR%/*/*/*}"
88

99
cd "$CHALLENGER_DIR"
1010
make

op-challenger/scripts/alphabet/mallory.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
set -euo pipefail
33

44
SOURCE_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
5-
CHALLENGER_DIR=$(echo "${SOURCE_DIR%/*/*}")
6-
MONOREPO_DIR=$(echo "${SOURCE_DIR%/*/*/*}")
5+
CHALLENGER_DIR=$("${SOURCE_DIR%/*/*}")
6+
MONOREPO_DIR=$("${SOURCE_DIR%/*/*/*}")
77

88
# Check that the fault game address file exists
99
FAULT_GAME_ADDR_FILE="$CHALLENGER_DIR/.fault-game-address"

op-challenger/scripts/visualize.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ RPC="${1:?Must specify RPC address}"
66
FAULT_GAME_ADDRESS="${2:?Must specify game address}"
77

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

1212
forge script scripts/FaultDisputeGameViz.s.sol \

packages/contracts-bedrock/scripts/generate-l2-genesis.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ cleanup() {
3131
wait_l2_outfile() {
3232
i=1
3333
while [ $i -le "$2" ]; do
34-
i=$(($i + 1))
34+
i=$((i + 1))
3535

3636
if [ ! -f "$OUTFILE_L2" ]; then
3737
sleep "$1"

packages/contracts-bedrock/scripts/slither.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ fi
5757
# Findings to keep are output to the slither-report.json output file.
5858
# Checking in a json file is cleaner than adding slither-disable comments throughout the codebase.
5959
# See slither.config.json for slither settings and to disable specific detectors.
60-
if [[ ! -z "$TRIAGE_MODE" ]]; then
60+
if [[ -n "$TRIAGE_MODE" ]]; then
6161
echo "Running slither in triage mode"
6262
SLITHER_OUTPUT=$(slither . --triage-mode --json $SLITHER_REPORT || true)
6363

0 commit comments

Comments
 (0)