ADR-0001: Shared pre-commit policy for A2C-governed repositories
- Status: Accepted
- Date: 2026-06-11
- Deciders: Michel Gillet
Context
A2C-governed repositories need consistent engineering rails without turning every commit into a repository-wide cleanup exercise. Teams also need a clear model for when local hooks, CI, and deliberate full-tree runs apply.
Without an explicit cross-repository standard, projects may omit shared hook configuration, run pre-commit run --all-files in CI by default, or perform repository-wide cleanup implicitly rather than as a conscious team decision.
Decision
Adopt the following shared pre-commit policy for A2C-governed software repositories:
-
Shared configuration is required — every A2C-governed software repository must version a shared
.pre-commit-config.yamlappropriate to its language or stack, treated as standard engineering rails. Reuse common language/stack templates where possible. -
Default scope is changed files — local pre-commit hooks run on staged or changed files. CI runs the equivalent checks on changed files for the commit or merge request, not the entire repository by default.
-
--all-filesis deliberate and manual —pre-commit run --all-filesis permitted when the team explicitly chooses repository-wide cleanup (for example after adding hooks, tightening rules, or onboarding legacy code). It is not the default CI behavior. After the cleanup commit, normal changed-file enforcement resumes. -
Fast feedback — hooks stay fast and focused: formatting, linting, simple static checks, secret detection, and only very fast tests where appropriate. Heavy or slow test suites remain outside the commit path unless a project explicitly decides otherwise.
Consequences
Positive
- Standards apply to new and modified work without forcing retroactive cleanup of untouched legacy files
- Shared hook configuration is an explicit, versioned project artifact
- Repository-wide cleanup remains possible but visible in Git history as a deliberate team action
- CI stays fast and aligned with day-to-day local hook behavior
Negative
- Legacy files outside the changed-file scope may remain non-compliant until a deliberate
--all-filescleanup - CI must implement a changed-files pre-commit invocation (not only
--all-files) - Teams must remember the manual cleanup path when tightening hooks on existing repositories
References
- docs/workflow/pre-commit-policy.md
- ADR-0003 — mandatory
a2c-pre-commit-hooksbaseline (complements this ADR) - rules/09-pre-commit-policy.md
- templates/pre-commit/policy-checklist.md