Motivation
prek is a faster, compatible replacement for pre-commit. The speed improvement is especially relevant when AI agents run checks after every round of edits, but it also benefits normal developer workflows.
This was already done for CausalPy in pymc-labs/CausalPy#780.
Proposed changes
Local developer workflow
- Replace
pre-commit install with prek install in setup/contributor docs.
- Contributors install
prek instead of pre-commit (the .pre-commit-config.yaml format is compatible, no hook config changes needed).
CI
- Replace the current
pre-commit/action@v3.0.0 GitHub Action (.github/workflows/pre-commit.yml) with j178/prek-action.
- Use smart scoping:
--from-ref / --to-ref on pull requests to only check changed files, and --all-files on pushes to main.
Documentation
- Update
CONTRIBUTING.md references from pre-commit to prek.
- Update any other docs or contributor guides that mention pre-commit.
Current setup
The repo currently uses:
.pre-commit-config.yaml with hooks for black, nbqa (isort, pyupgrade), execution-order checking, bibtex-tidy, watermark checks, notebook-name checks, reference-url checks, and jupytext sync.
.github/workflows/pre-commit.yml running pre-commit/action@v3.0.0 on PRs and pushes to main.
CONTRIBUTING.md referencing pre-commit in the PR checklist.
Reference
Motivation
prek is a faster, compatible replacement for pre-commit. The speed improvement is especially relevant when AI agents run checks after every round of edits, but it also benefits normal developer workflows.
This was already done for CausalPy in pymc-labs/CausalPy#780.
Proposed changes
Local developer workflow
pre-commit installwithprek installin setup/contributor docs.prekinstead ofpre-commit(the.pre-commit-config.yamlformat is compatible, no hook config changes needed).CI
pre-commit/action@v3.0.0GitHub Action (.github/workflows/pre-commit.yml) withj178/prek-action.--from-ref/--to-refon pull requests to only check changed files, and--all-fileson pushes tomain.Documentation
CONTRIBUTING.mdreferences frompre-committoprek.Current setup
The repo currently uses:
.pre-commit-config.yamlwith hooks for black, nbqa (isort, pyupgrade), execution-order checking, bibtex-tidy, watermark checks, notebook-name checks, reference-url checks, and jupytext sync..github/workflows/pre-commit.ymlrunningpre-commit/action@v3.0.0on PRs and pushes to main.CONTRIBUTING.mdreferencing pre-commit in the PR checklist.Reference