Prek: A better, faster, drop-in pre-commit replacement, engineered in Rust

Perceived value of git hooks vs scripts/CI/IDE

  • Some see git hooks as an unnecessary wrapper over shell scripts, preferring to invoke scripts directly and keep all enforcement in CI.
  • Others argue hooks save time by failing fast locally (linting, formatting, basic tests) instead of after a long CI run, especially when developers may not monitor CI promptly.
  • A common pattern: define checks in CI first, then mirror them in pre-commit so local and remote behavior stay aligned.

Where and when checks should run

  • Several commenters think pre-commit is the “wrong” place; they prefer pre-push (or pre-receive) for heavy checks, using pre-commit only for very fast tasks like formatting.
  • Others dislike any blocking hooks and advocate background daemons or watchers that continuously run checks per change (e.g., SelfCI, limmat) or simply in-editor tooling.
  • A layered approach is popular: IDE → pre-commit/pre-push → CI, each layer slower and more comprehensive.

Prek vs pre-commit: performance and features

  • Many say pre-commit performance has never been an issue for them; the bottleneck is usually the underlying tools, not the framework.
  • Others report slow behavior in large monorepos or with Python-based hooks (env creation, updates). Prek’s Rust core and uv-based Python management are seen as improvements here.
  • Prek’s standout feature in the thread is good monorepo/workspace support and compatibility with existing pre-commit configs.

Alternative hook frameworks and designs

  • Tools mentioned: lefthook, hk (with Pkl/mise integration), nit (WASI-based hooks with virtual FS), treefmt, and environment managers like Devenv and mise.
  • Some prefer simpler frameworks (lefthook, husky) or first‑party “plugins” (hk) to reduce supply-chain risk and complexity.

Critiques of pre-commit’s platform

  • Complaints: mixing tool installation with linting, weak parallelism model, reliance on many third‑party plugin repos, and awkward behavior with unstaged changes or rebases.
  • Some feel pre-commit hooks are fragile, noisy, and too easy to bypass; others counter that this flexibility is desirable.

Rust and reception

  • A few are enthusiastic about a fast Rust core; others mock “written in Rust” as over-marketed and not inherently meaningful.