pymc-devs / pymc-devs/pymc-examples

Swap pre-commit for prek

Open
#853 0 comments 0 reactions 0 assignees View on GitHub

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 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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.