Trim pre-commit to Julia-appropriate hooks#75
Merged
Conversation
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 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #75 +/- ##
=======================================
Coverage 95.68% 95.68%
=======================================
Files 5 5
Lines 139 139
=======================================
Hits 133 133
Misses 6 6 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Pre-commit CI on this repo is very slow. The cause isn't any recent change — it's hook environment setup.
pre-commit run --all-filesbuilds every hook's environment before running, regardless of whether matching files exist. This is a Julia package with no.py,.R, or.javafiles, yet the config installed hooks for all three:lintr(lorenzwalthert/precommit) — bootstraps anrenvlibrary and compileslintr+ its dependency tree. Several minutes on a cold cache, and there's nothing to lint. This is the dominant cost.pretty-format-java— needs a Java formatter; no Java files.Cold rebuilds happen easily because the cache key (
pre-commit-4|${pythonLocation}|hashFiles(config)) has norestore-keysfallback.What
detect-secrets.runicCI job (fredrikekre/runic-action).r-lib/actions/setup-rstep from the workflow and the dead~/.cache/R/renvcache path from the composite action.Result
Locally,
pre-commit run --all-filesnow completes in ~6s cold (only two small hook environments to build), with all checks passing.🤖 Generated with Claude Code