Skip to main content

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:

  1. Shared configuration is required — every A2C-governed software repository must version a shared .pre-commit-config.yaml appropriate to its language or stack, treated as standard engineering rails. Reuse common language/stack templates where possible.

  2. 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.

  3. --all-files is deliberate and manualpre-commit run --all-files is 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.

  4. 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-files cleanup
  • 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