Skip to content

Commit

Permalink
Fix SC2155 issues (#1975)
Browse files Browse the repository at this point in the history
I forgot to include this in
#1971 (made the change locally
and forgot to push before merging).

I originally suppressed these lints because I misunderstood how `set -o
errexit` interacts with `readonly`. I thought a failure would still
bring down the whole script, but that's not the case. So instead of
suppressing the lint, I fixed the issue.
  • Loading branch information
mlevesquedion authored Jan 31, 2024
1 parent 9a52ae0 commit 968b59a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions build_tools/github_actions/lint_buildifier.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ if ! command -v buildifier &> /dev/null; then
exit 1
fi

# shellcheck disable=SC2155
readonly SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
readonly SCRIPT_DIR
readonly STABLEHLO_ROOT_DIR="${SCRIPT_DIR}/../.."

cd "$STABLEHLO_ROOT_DIR"
Expand Down
4 changes: 2 additions & 2 deletions build_tools/github_actions/lint_markdown.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ if [[ $# -gt 2 ]] ; then
exit 1
fi

# shellcheck disable=SC2155
readonly SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
readonly SCRIPT_DIR
readonly STABLEHLO_ROOT_DIR="${SCRIPT_DIR}/../.."

# These must be relative to the repo root because that's the context
Expand Down
4 changes: 2 additions & 2 deletions build_tools/github_actions/lint_shellcheck.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ if ! command -v shellcheck &> /dev/null; then
exit 1
fi

# shellcheck disable=SC2155
readonly SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
readonly SCRIPT_DIR
readonly STABLEHLO_ROOT_DIR="${SCRIPT_DIR}/../.."

cd "$STABLEHLO_ROOT_DIR"
Expand Down

0 comments on commit 968b59a

Please sign in to comment.