pymc-devs / pymc-devs/pymc-examples
Swap pre-commit for prek
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 398
- Forks
- 325
- Avg merge
- 9d 15m
- Merged PRs (30d)
- 1
Description
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 installwithprek installin setup/contributor docs. - Contributors install
prekinstead ofpre-commit(the.pre-commit-config.yamlformat is compatible, no hook config changes needed).
CI
- Replace the current
pre-commit/action@v3.0.0GitHub Action (.github/workflows/pre-commit.yml) withj178/prek-action. - Use smart scoping:
--from-ref/--to-refon pull requests to only check changed files, and--all-fileson pushes tomain.
Documentation
- Update
CONTRIBUTING.mdreferences frompre-committoprek. - Update any other docs or contributor guides that mention pre-commit.
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
- prek docs: https://prek.j178.dev
- CausalPy PR: https://github.com/pymc-labs/CausalPy/pull/780
- CausalPy issue: https://github.com/pymc-labs/CausalPy/issues/779
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with .github/workflows/pre-commit.yml, CONTRIBUTING.md, and .pre-commit-config.yaml, then search the repository for other pre-commit references. Replace the local and CI commands as described, preserving the existing hook configuration and adding the requested PR versus main scoping. Done means contributor docs and both workflow paths consistently use prek.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- github-actions, python
- Domain
- ci-cd, developer-experience, documentation
- Issue type
- Refactor
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 48/100