Skip to content

chore(dev): replace pre-commit with prek - #343

Merged
joshuarli merged 4 commits into
mainfrom
refactor/replace-pre-commit-with-prek
Nov 23, 2026
Merged

joshuarli merged 4 commits into
mainfrom
refactor/replace-pre-commit-with-prek

Conversation

@joshuarli

@joshuarli joshuarli commented Nov 23, 2026 •

Copy link
Copy Markdown
Member

Replaces pre-commit with prek as the dev hook runner.

pre-commit was the only reason virtualenv was in uv.lock — the advisories from PR #341 came from that transitive dependency. Switching to prek drops virtualenv, distlib, filelock, platformdirs, cfgv, identify, and nodeenv from the lock instead of bumping one of them.

  • end-of-file-fixer and trailing-whitespace move to prek's builtin hooks; the local ruff/mypy/shellcheck hooks are unchanged.
  • .envrc installs the git hook with prek install --prepare-hooks -f.
  • CI runs .venv/bin/prek run --all-files --show-diff-on-failure against a frozen lock.

Verified locally: uv lock --check, prek run --all-files (all hooks pass), and the installed git hook ran on commit.

Refs DI-2953.

pre-commit pulls virtualenv and its command-injection advisories into the dev lock. prek is pre-commit-compatible and manages hook environments with uv, so virtualenv and its transitive dependencies drop out entirely.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Want higher recall? High effort reviews run extra passes and find more bugs. A team admin can switch effort levels in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit a91201f. Configure here.

Comment thread .envrc Resolved
@linear-code

linear-code Bot commented Nov 23, 2026

Copy link
Copy Markdown

DI-2953

Existing checkouts have a .venv from before the prek migration, so uv sync was skipped and prek was never installed. Sync whenever .venv/bin/prek is missing so the prek hook can be installed.
@joshuarli
joshuarli merged commit 677f2a3 into main Nov 23, 2026
19 checks passed
@joshuarli
joshuarli deleted the refactor/replace-pre-commit-with-prek branch November 23, 2026 18:45
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.

2 participants