[PR #9044] [MERGED] chore: optimize pre-commit hooks for faster commits #25298

Closed
opened 2026-04-15 22:49:06 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/9044
Author: @gustavovalverde
Created: 4/8/2026
Status: Merged
Merged: 4/9/2026
Merged by: @gustavovalverde

Base: mainHead: chore/optimize-pre-commit-hooks


📝 Commits (2)

  • 4c42667 chore: optimize pre-commit hooks for faster commits
  • a4253e2 chore: simplify pre-commit hooks documentation

📊 Changes

4 files changed (+17 additions, -6 deletions)

View changed files

📝 .cspell.jsonc (+2 -1)
📝 .gitignore (+4 -0)
📝 CONTRIBUTING.md (+9 -2)
📝 lefthook.yml (+2 -3)

📄 Description

Summary

  • Add parallel: true to lefthook — hooks now run concurrently instead of sequentially
  • Remove knip (lint:dependencies) from pre-commit — it has no incremental mode and always scans the full repo (~11s). Already runs in CI
  • Add --cache to cspell for faster repeated spell checks
  • Add .cspellcache and lefthook-local.yml to .gitignore
  • Ignore .gitignore in cspell config (standard boilerplate template words)
  • Document pre-commit hooks and contributor escape hatches in CONTRIBUTING.md

Before: ~16.8s sequential (biome + cspell + knip two passes)
After: ~4-5s parallel (bottlenecked on biome, which does real work)


Summary by cubic

Speed up pre-commit by running hooks in parallel and caching spell checks. Commit time drops from ~16.8s to ~4–5s.

  • Refactors
    • Enabled concurrent hooks via lefthook (parallel: true).
    • Added --cache to cspell; ignore .gitignore; added .cspellcache to .gitignore.
    • Removed knip from pre-commit (CI-only).
    • Simplified and documented pre-commit behavior in CONTRIBUTING, including LEFTHOOK_EXCLUDE.

Written for commit a4253e2878. Summary will update on new commits.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/better-auth/better-auth/pull/9044 **Author:** [@gustavovalverde](https://github.com/gustavovalverde) **Created:** 4/8/2026 **Status:** ✅ Merged **Merged:** 4/9/2026 **Merged by:** [@gustavovalverde](https://github.com/gustavovalverde) **Base:** `main` ← **Head:** `chore/optimize-pre-commit-hooks` --- ### 📝 Commits (2) - [`4c42667`](https://github.com/better-auth/better-auth/commit/4c42667386369da0d5f6dbbae84e293485459f57) chore: optimize pre-commit hooks for faster commits - [`a4253e2`](https://github.com/better-auth/better-auth/commit/a4253e2878d4eb3b80fdca75861399fdcd3b04e9) chore: simplify pre-commit hooks documentation ### 📊 Changes **4 files changed** (+17 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `.cspell.jsonc` (+2 -1) 📝 `.gitignore` (+4 -0) 📝 `CONTRIBUTING.md` (+9 -2) 📝 `lefthook.yml` (+2 -3) </details> ### 📄 Description ## Summary - Add `parallel: true` to lefthook — hooks now run concurrently instead of sequentially - Remove knip (`lint:dependencies`) from pre-commit — it has no incremental mode and always scans the full repo (~11s). Already runs in CI - Add `--cache` to cspell for faster repeated spell checks - Add `.cspellcache` and `lefthook-local.yml` to `.gitignore` - Ignore `.gitignore` in cspell config (standard boilerplate template words) - Document pre-commit hooks and contributor escape hatches in `CONTRIBUTING.md` **Before:** ~16.8s sequential (biome + cspell + knip two passes) **After:** ~4-5s parallel (bottlenecked on biome, which does real work) <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Speed up pre-commit by running hooks in parallel and caching spell checks. Commit time drops from ~16.8s to ~4–5s. - **Refactors** - Enabled concurrent hooks via `lefthook` (`parallel: true`). - Added `--cache` to `cspell`; ignore `.gitignore`; added `.cspellcache` to `.gitignore`. - Removed `knip` from pre-commit (CI-only). - Simplified and documented pre-commit behavior in CONTRIBUTING, including `LEFTHOOK_EXCLUDE`. <sup>Written for commit a4253e2878d4eb3b80fdca75861399fdcd3b04e9. Summary will update on new commits.</sup> <!-- End of auto-generated description by cubic. --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-15 22:49:06 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#25298