Lefthook Rules
Fast, polyglot Git hooks manager. Run linters, formatters, and tests automatically on commit, push, and merge.
3 rules
Check Placement by Hook Stage
Beginner
Define which checks belong in pre-commit vs pre-push — fast checks (lint, format, secrets) in pre-commit, slow checks (tests, typecheck, build) in pre-push.
globs: **/lefthook.yml, **/lefthook-local.yml
hook-stages, pre-commit, pre-push, performance
View Rule
Parallel Execution Requirement
Beginner
Require parallel execution for independent Lefthook commands — lint, format, and security checks must run simultaneously to keep pre-commit hooks under 10 seconds.
globs: **/lefthook.yml, **/lefthook-local.yml
parallel, performance, hook-speed, developer-experience
View Rule
Check Only Staged Files
Beginner
Require Lefthook pre-commit commands to operate on staged files only — use {staged_files} placeholder and glob filters to avoid checking the entire codebase on every commit.
globs: **/lefthook.yml, **/lefthook-local.yml
staged-files, performance, file-filtering, pre-commit
View Rule