From 9f8edb0b6957d3f01a53a93252bd4e652772c2b2 Mon Sep 17 00:00:00 2001 From: Chi-Sheng Liu Date: Mon, 20 Jan 2025 10:02:34 +0800 Subject: [PATCH] [CI] Run partial pre-commit rules in CI Signed-off-by: Chi-Sheng Liu --- .pre-commit-config.yaml | 2 +- ci/lint/lint.sh | 18 +++++++++++++++--- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index dd60e14091723..7e1a5bc7d06b1 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -135,7 +135,7 @@ repos: - repo: local hooks: - - id: check_cpp_files_inclusion + - id: check-cpp-files-inclusion name: Check ray core C++ files inclusion violations entry: ci/lint/check_cpp_files_inclusion.py language: python diff --git a/ci/lint/lint.sh b/ci/lint/lint.sh index 135ebfc7f15f8..4bef95c0c894d 100755 --- a/ci/lint/lint.sh +++ b/ci/lint/lint.sh @@ -12,10 +12,22 @@ clang_format() { pre_commit() { # Run pre-commit on all files - # TODO(MortalHappiness): Run all pre-commit checks - # Currently, we only run the ruff format check - pip install -c python/requirements_compiled.txt pre-commit + # TODO(MortalHappiness): Run all pre-commit checks because currently we only run some of them. + pip install -c python/requirements_compiled.txt pre-commit clang-format pre-commit run ruff --all-files --show-diff-on-failure + pre-commit run check-added-large-files --all-files --show-diff-on-failure + pre-commit run check-ast --all-files --show-diff-on-failure + pre-commit run check-toml --all-files --show-diff-on-failure + pre-commit run black --all-files --show-diff-on-failure + pre-commit run prettier --all-files --show-diff-on-failure + pre-commit run mypy --all-files --show-diff-on-failure + pre-commit run rst-directive-colons --all-files --show-diff-on-failure + pre-commit run rst-inline-touching-normal --all-files --show-diff-on-failure + pre-commit run python-check-mock-methods --all-files --show-diff-on-failure + pre-commit run clang-format --all-files --show-diff-on-failure + pre-commit run docstyle --all-files --show-diff-on-failure + pre-commit run check-import-order --all-files --show-diff-on-failure + pre-commit run check-cpp-files-inclusion --all-files --show-diff-on-failure } code_format() {