hooks/config-present
Git hooks are configured
| Severity | error |
| Tiers | 1, 2 |
| Stacks | any |
| Scope | root |
| Kind | expr |
| Source | library v0.6.0 |
| Selected by | fleetlint-minimal@v0.6.0 |
Requirement
The repository declares git hooks that run on every commit: a .pre-commit-config.yaml (pre-commit or prek) or a lefthook configuration (lefthook.yml, .lefthook.yml and their YAML, TOML and JSON variants).
Why
Hooks are the only gate that runs before code reaches the remote; everything else is after the fact.
Check
[".pre-commit-config.yaml", "lefthook.yml", "lefthook.yaml", "lefthook.toml", "lefthook.json", "lefthook.jsonc",
".lefthook.yml", ".lefthook.yaml", ".lefthook.toml", ".lefthook.json", ".lefthook.jsonc"].exists(f, file(f))Fix
Run fleetlint fix --apply to add .pre-commit-config.yaml for the stack, then prek install (the file uses prek’s builtin hooks; pre-commit cannot run it).
Agent instruction: Create .pre-commit-config.yaml from the shared template plus the stack block, run prek update and prek install.
fleetlint fix can apply this rule’s fix automatically (1 action(s)).
A finding of this rule points at .pre-commit-config.yaml.
Sources
- https://fleetlint.org/baseline/#git-hooks (convention)
- https://pre-commit.com/ (spec, .pre-commit-config.yaml - top level)
- https://lefthook.dev/ (spec)
Generated by fleetlint docs from catalog v0.6.0.