Skip to content

Commit

Permalink
[CI] Fix shellcheck warning in pre-commit (#50288)
Browse files Browse the repository at this point in the history
and enable it on CI

---------

Signed-off-by: owenowenisme <[email protected]>
  • Loading branch information
owenowenisme authored Feb 10, 2025
1 parent e018b35 commit a5644dd
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 11 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ repos:
- id: python-no-log-warn
- id: python-check-mock-methods

- repo: https://github.com/koalaman/shellcheck-precommit
rev: v0.9.0
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.9.0.1
hooks:
- id: shellcheck
args: ['--exclude=1090,1091,2207']
Expand Down
1 change: 1 addition & 0 deletions ci/lint/lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ pre_commit() {
rst-inline-touching-normal
python-check-mock-methods
clang-format
shellcheck
docstyle
check-import-order
check-cpp-files-inclusion
Expand Down
8 changes: 6 additions & 2 deletions ci/ray_ci/macos/macos_ci_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ export TORCHVISION_VERSION=0.15.2
build_x86_64() {
# Cleanup environments
rm -rf /tmp/bazel_event_logs
cleanup() { if [ "${BUILDKITE_PULL_REQUEST}" = "false" ]; then ./ci/build/upload_build_info.sh; fi }; trap cleanup EXIT
# shellcheck disable=SC2317
cleanup() { if [ "${BUILDKITE_PULL_REQUEST}" = "false" ]; then ./ci/build/upload_build_info.sh; fi }
trap cleanup EXIT
(which bazel && bazel clean) || true
# TODO(simon): make sure to change both PR and wheel builds
# Special setup for jar builds (will be installed to the machine instead)
Expand Down Expand Up @@ -54,7 +56,9 @@ build_x86_64() {
build_aarch64() {
# Cleanup environments
rm -rf /tmp/bazel_event_logs
cleanup() { if [ "${BUILDKITE_PULL_REQUEST}" = "false" ]; then ./ci/build/upload_build_info.sh; fi }; trap cleanup EXIT
# shellcheck disable=SC2317
cleanup() { if [ "${BUILDKITE_PULL_REQUEST}" = "false" ]; then ./ci/build/upload_build_info.sh; fi }
trap cleanup EXIT
(which bazel && bazel clean) || true
brew install pkg-config nvm node || true
# TODO(simon): make sure to change both PR and wheel builds
Expand Down
6 changes: 0 additions & 6 deletions ci/ray_ci/rllib_contrib/rllib_contrib_ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -134,12 +134,6 @@ test_slate_q() {
bazel test --config=ci $(./ci/run/bazel_export_options) --build_tests_only --test_tag_filters=-flaky,learning_tests --test_arg=--framework=torch rllib_contrib/slate_q/...
}

test_td3() {
build "td3"
# BAZEL (learning and compilation) tests:
bazel test --config=ci $(./ci/run/bazel_export_options) --build_tests_only --test_tag_filters=-flaky rllib_contrib/td3/...
}

test_a3c() {
build "a3c"
# BAZEL (learning and compilation) tests:
Expand Down
2 changes: 1 addition & 1 deletion setup_hooks.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
set -eu

# This stops git rev-parse from failing if we run this from the .git directory
Expand Down

0 comments on commit a5644dd

Please sign in to comment.