From b0f49f6b3400a5a56afc50a3af28886632ce0136 Mon Sep 17 00:00:00 2001 From: Samuel Brand <48288458+SamuelBrand1@users.noreply.github.com> Date: Tue, 2 Jun 2026 15:03:56 +0100 Subject: [PATCH] Trim pre-commit to Julia-appropriate hooks This repo is a Julia package with no Python, R, or Java source files, yet pre-commit configured hooks for all three. On a cold GitHub Actions cache, `pre-commit run --all-files` had to build every hook environment up front; the R `lintr` hook (lorenzwalthert/precommit) bootstrapped an renv library and compiled lintr + its dependency tree, which dominated CI runtime for no benefit (there is nothing for it to lint). Remove the ruff (Python), lintr (R) and pretty-format-java (Java) hooks, keeping the generic file-cleanliness hooks and detect-secrets. Julia formatting is already handled by the separate `runic` CI job. Also drop the now-unused R setup step from the pre-commit workflow and the dead renv cache path from the composite action. Locally, `pre-commit run --all-files` now completes in ~6s cold (was minutes). Co-Authored-By: Claude Opus 4.8 --- .github/actions/pre-commit/action.yaml | 1 - .github/workflows/pre-commit.yaml | 3 --- .pre-commit-config.yaml | 33 ++++---------------------- 3 files changed, 5 insertions(+), 32 deletions(-) diff --git a/.github/actions/pre-commit/action.yaml b/.github/actions/pre-commit/action.yaml index debac13..65cf433 100644 --- a/.github/actions/pre-commit/action.yaml +++ b/.github/actions/pre-commit/action.yaml @@ -16,7 +16,6 @@ runs: with: path: | ~/.cache/pre-commit - ~/.cache/R/renv key: pre-commit-4|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml') }} - run: SKIP=runic pre-commit run --show-diff-on-failure --color=always ${{ inputs.extra_args }} shell: bash diff --git a/.github/workflows/pre-commit.yaml b/.github/workflows/pre-commit.yaml index ba4038c..9c555d2 100644 --- a/.github/workflows/pre-commit.yaml +++ b/.github/workflows/pre-commit.yaml @@ -11,9 +11,6 @@ jobs: steps: - uses: actions/checkout@v6 - uses: actions/setup-python@v6 - - uses: r-lib/actions/setup-r@v2 - with: - use-public-rspm: true - uses: ./.github/actions/pre-commit runic: runs-on: ubuntu-latest diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 078c777..4a3d3e6 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -11,34 +11,6 @@ repos: - id: mixed-line-ending - id: trailing-whitespace ##### -# Python -- repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.11.10 - hooks: - # Sort imports - - id: ruff - args: ['check', '--select', 'I', '--fix'] - # Run the linter - - id: ruff - args: ['--line-length', '79'] - # Run the formatter - - id: ruff-format - args: ['--line-length', '79'] -##### -# R -- repo: https://github.com/lorenzwalthert/precommit - rev: v0.4.3.9009 - hooks: - - id: lintr -##### -# Java -- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks - rev: v2.14.0 - hooks: - - id: pretty-format-java - args: [--aosp,--autofix] - -##### # Secrets - repo: https://github.com/Yelp/detect-secrets rev: v1.5.0 @@ -46,3 +18,8 @@ repos: - id: detect-secrets args: ['--baseline', '.secrets.baseline'] exclude: package.lock.json +# NOTE: This is a Julia package. Julia formatting is handled by the separate +# `runic` CI job (fredrikekre/runic-action). The previous Python (ruff), R +# (lintr) and Java (pretty-format-java) hooks were removed: there are no such +# source files in this repo, and the R `lintr` hook in particular bootstrapped +# an renv library on every cold cache, which dominated pre-commit CI runtime.