From 9c81dfa8645585dda473689d56673dfb1cd45bf9 Mon Sep 17 00:00:00 2001 From: Thaddeus Crews Date: Fri, 1 May 2026 13:43:49 -0500 Subject: [PATCH] CI: Replace `pre-commit` with `prek` --- .clang-format | 2 +- .clang-tidy | 2 +- .github/actions/pre-commit/action.yml | 25 ------------------------- .github/workflows/static_checks.yml | 6 +++--- .gitignore | 1 - 5 files changed, 5 insertions(+), 31 deletions(-) delete mode 100644 .github/actions/pre-commit/action.yml diff --git a/.clang-format b/.clang-format index 59d0158309..46bbf6b339 100644 --- a/.clang-format +++ b/.clang-format @@ -1,5 +1,5 @@ # If you change this file, please format all files of the codebase as part of your PR: -# pre-commit run clang-format --all +# prek run clang-format --all # Commented out parameters are those with the same value as base LLVM style. # We can uncomment them if we want to change their value, or enforce the diff --git a/.clang-tidy b/.clang-tidy index 19965f3e4f..1c19e93fb1 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -1,5 +1,5 @@ # If you change this file, please format all files of the codebase as part of your PR: -# pre-commit run --hook-stage manual clang-tidy --all +# prek run --hook-stage manual clang-tidy --all Checks: - -* diff --git a/.github/actions/pre-commit/action.yml b/.github/actions/pre-commit/action.yml deleted file mode 100644 index 669f1e0602..0000000000 --- a/.github/actions/pre-commit/action.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: Pre-commit -description: Setup pre-commit, and run it. - -inputs: - extra_args: - description: Options to pass to pre-commit run - required: false - default: '--all-files' - -runs: - using: composite - steps: - - uses: actions/cache@v5 - with: - path: ~/.cache/pre-commit - key: pre-commit|${{ hashFiles('.pre-commit-config.yaml') }} - - - run: | - pip install pre-commit - pre-commit install - shell: bash - - - run: | - pre-commit run --show-diff-on-failure --color=always --files ${{ inputs.extra_args }} - shell: bash diff --git a/.github/workflows/static_checks.yml b/.github/workflows/static_checks.yml index 61d0559949..d54ed4b5bc 100644 --- a/.github/workflows/static_checks.yml +++ b/.github/workflows/static_checks.yml @@ -39,9 +39,9 @@ jobs: skip_initial_fetch: true files_yaml_from_source_file: .github/changed_files.yml - - name: Style checks via pre-commit - uses: ./.github/actions/pre-commit + - name: Style checks via prek + uses: j178/prek-action@v2 env: CHANGED_FILES: '"${{ steps.changed-files.outputs.everything_all_changed_files }}"' # Wrap with quotes to bookend internal quote separators. with: - extra_args: --files ${{ env.CHANGED_FILES }} + extra-args: --files ${{ env.CHANGED_FILES }} diff --git a/.gitignore b/.gitignore index 4e17dc323b..1406aa529c 100644 --- a/.gitignore +++ b/.gitignore @@ -23,7 +23,6 @@ ########################### /custom.py -misc/hooks/pre-commit-custom-* ############################# ### Godot generated files ###