Skip to content

Conversation

@blooop
Copy link
Owner

@blooop blooop commented Jan 16, 2026

Replace the pre-commit hook manager with prek, a faster Rust-based
alternative that's fully compatible with existing pre-commit configurations.

Changes:

  • Updated pyproject.toml to use prek instead of pre-commit
  • Renamed pixi tasks from pre-commit/pre-commit-update to prek/prek-update
  • Updated GitHub Actions workflow to use j178/prek-action@v1
  • Renamed workflow file from pre-commit.yaml to prek.yaml
  • Updated documentation in README.md and .claude/README.md
  • Updated SessionStart hook to install prek hooks
  • Updated dependabot.yml to track prek instead of pre-commit

The .pre-commit-config.yaml file remains unchanged as prek uses the
same configuration format.

Summary by Sourcery

Replace the project’s pre-commit hook integration with the compatible, Rust-based prek tool across local tooling, automation, and documentation.

Enhancements:

  • Switch local hook runner from pre-commit to prek in pyproject tasks and dependency declarations.
  • Update composite pixi workflows (e.g. fix task) to rely on prek for running code quality hooks.
  • Migrate the GitHub pull_request hook workflow from pre-commit/action to j178/prek-action@v1 and rename the workflow accordingly.
  • Adjust Claude SessionStart automation to install/configure prek hooks instead of pre-commit.
  • Refresh user-facing documentation and Dependabot configuration to reference prek instead of pre-commit.

Replace the pre-commit hook manager with prek, a faster Rust-based
alternative that's fully compatible with existing pre-commit configurations.

Changes:
- Updated pyproject.toml to use prek instead of pre-commit
- Renamed pixi tasks from pre-commit/pre-commit-update to prek/prek-update
- Updated GitHub Actions workflow to use j178/prek-action@v1
- Renamed workflow file from pre-commit.yaml to prek.yaml
- Updated documentation in README.md and .claude/README.md
- Updated SessionStart hook to install prek hooks
- Updated dependabot.yml to track prek instead of pre-commit

The .pre-commit-config.yaml file remains unchanged as prek uses the
same configuration format.
@sourcery-ai
Copy link

sourcery-ai bot commented Jan 16, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Replaces the Python-based pre-commit hook runner with the Rust-based prek across tooling, automation, and docs while keeping the existing .pre-commit-config.yaml configuration format unchanged.

Flow diagram for updated pixi tasks using prek

flowchart TD
  subgraph PixiTasks
    UpdateLock[update-lock]
    Format[format]
    RuffLint[ruff-lint]
    Prek[prek]
    Fix[fix]
  end

  Fix -->|depends-on| UpdateLock
  Fix -->|depends-on| Format
  Fix -->|depends-on| RuffLint
  Fix -->|depends-on| Prek

  UpdateLock -->|updates| PixiLock[pixi.lock]
  Format -->|runs| RuffFormat[ruff format .]
  RuffLint -->|runs| RuffCheck[ruff check . --fix]
  Prek -->|runs| PrekRunAll[prek run -a]

  PrekUpdate[prek-update] -->|runs| PrekAutoupdate[prek autoupdate]

  Dev[Developer] -->|pixi run fix| Fix
  Dev -->|pixi run prek| Prek
  Dev -->|pixi run prek-update| PrekUpdate
Loading

File-Level Changes

Change Details Files
Switch local development tooling from pre-commit to prek and wire it into pixi tasks and the fix pipeline.
  • Replace pre-commit dependency with prek in pyproject optional dev/test tooling dependencies
  • Rename pixi tasks from pre-commit/pre-commit-update to prek/prek-update and update dependent tasks (e.g., fix) to call prek
  • Ensure CLI invocations use equivalent prek commands (run -a, autoupdate) so existing hook behavior is preserved
pyproject.toml
Update continuous integration to run prek instead of pre-commit on pull requests.
  • Rename pre-commit GitHub Actions workflow file and job to prek to reflect the new tool
  • Replace pre-commit/action with j178/prek-action@v1 while keeping the same trigger (pull_request) and checkout step
.github/workflows/pre-commit.yaml
.github/workflows/prek.yaml
Align automation and dependency update tooling with prek instead of pre-commit.
  • Update Dependabot configuration to track prek rather than pre-commit in grouped development dependency updates
  • Adjust SessionStart hook to install and configure prek hooks instead of pre-commit while keeping the same overall setup flow
.github/dependabot.yml
.claude/hooks/SessionStart
Refresh documentation to reference prek hooks and new pixi tasks.
  • Update Claude-related README to document prek tasks (prek, prek-update) and troubleshooting commands
  • Update main README to state that the environment setup configures prek hooks instead of pre-commit hooks
.claude/README.md
README.md

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

- Corrected prek version from >=0.13.0 to >=0.2.28,<0.3.0
- Updated pixi.lock to replace pre-commit with prek 0.2.28
- Removed pre-commit package and its dependencies from lock file

This fixes CI errors where the incorrect version constraint made
the dependency resolution fail.
@blooop blooop merged commit 6efc5b0 into main Jan 16, 2026
7 checks passed
@blooop blooop deleted the claude/replace-precommit-with-prek-GqESc branch January 16, 2026 08:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants