ADR-021: Pre-commit hooks with strict validation¶
Category: development Provenance: guided-ai
Decision¶
Enforce code quality locally with pre-commit hooks: ruff (lint/format), ty (type check), mkdocs build, Helm lint, conventional commit validation, ADR validation.
Rationale¶
Fast feedback: Catch issues before push, not after CI fails. Consistency: Everyone runs same checks locally. Quality gates: Enforces code style, type safety, conventional commits. Productivity: Fixes most issues automatically (ruff format, trailing whitespace). CI efficiency: Reduces CI failures from style/lint issues.
Agent Instructions¶
Install hooks with 'make install-hooks' or 'uv run pre-commit install'. Hooks run automatically on 'git commit'. Fix issues before committing. Run manually with 'make quality' or 'uv run pre-commit run --all-files'. CI runs same checks - if it passes locally, it passes in CI. Never skip pre-commit hooks (--no-verify) without strong justification.