1 day ago · Tech · 0 comments

Previously. Today I learned: prek is a drop-in replacement for pre-commit, rewritten in Rust. Same .pre-commit-config.yaml, same hook ecosystem, much faster. A single binary with zero dependencies, much faster than the original pre-commit, drop-in compatible. Install: shell % brew install prek # or % cargo install prek Then swap the command. Nothing else changes: diff -pre-commit run --all-files +prek run --all-files Or skip the swap entirely: prek install -f drops in a shim that replaces the pre-commit binary, so existing scripts and git hooks keep working unchanged. The CI workflow on this blog (prek.yml) now uses j178/prek-action instead of pre-commit/action, and the monthly autoupdate job (prek-autoupdate.yml) runs prek auto-update --freeze — the --freeze flag works the same. The benchmark is what sold me. On cold caches, prek is around 10x faster at resolving and installing hooks; on warm runs, the difference is smaller but still noticeable. Two other niceties pre-commit does not…

No comments yet. Log in to reply on the Fediverse. Comments will appear here.