refactor(pc-author): retrofit to the ADR-0020 context contract
Description 475 -> 213 chars, body 680 -> 212 words. Create and modify become self-contained flow files behind a dispatch table, since the two are mutually exclusive on whether the config already exists. Passed its clean-context audit with no must-fix findings.
This commit is contained in:
@@ -11,6 +11,11 @@ source_keys:
|
||||
Use this table when creating a config from scratch or recommending hooks to add.
|
||||
Always check the existing config for duplicates before proposing.
|
||||
|
||||
Fixer hooks (`trailing-whitespace`, `end-of-file-fixer`, `pretty-format-json` and the like) rewrite
|
||||
files but do NOT re-stage them, so the commit is still blocked and the user has to stage and commit
|
||||
again. Say so when proposing one — otherwise the first blocked commit reads as the hook being
|
||||
broken.
|
||||
|
||||
## Universal (recommend for every repo)
|
||||
|
||||
| Hook ID | Repo | Rev | Rationale |
|
||||
@@ -101,6 +106,9 @@ Use for repo-specific scripts that don't belong in an external hook repo.
|
||||
stages: [pre-push]
|
||||
```
|
||||
|
||||
`language: system` and `language: script` are deprecated names for the first two below.
|
||||
New local hooks use `unsupported` and `unsupported_script`.
|
||||
|
||||
Language choices for local hooks:
|
||||
- `unsupported` — system PATH tool (pre-commit does not manage env)
|
||||
- `unsupported_script` — script at a repo-relative path
|
||||
@@ -117,4 +125,4 @@ Language choices for local hooks:
|
||||
|
||||
## Rev pin freshness
|
||||
|
||||
The revs above were last verified current at time of writing (matched against the plugin's own research corpus in `docs/research/docs/pre-commit/`; rows marked "Unverified" have no such backing and must be checked against upstream before use). Since `pc-author`'s "Rev staleness" check treats this table as ground truth, a pin that goes stale here produces false-positive staleness warnings for users who already have a newer, correct rev. Re-verify these pins periodically (e.g. against each repo's latest release tag). When in doubt, treat `pre-commit autoupdate`'s own output as the authoritative staleness signal, not a mismatch against this table.
|
||||
The revs above were last verified current at time of writing (matched against the plugin's own research corpus in `docs/research/docs/pre-commit/`; rows marked "Unverified" have no such backing and must be checked against upstream before use). Since the "Rev staleness" check in `references/modify-config.md` treats this table as ground truth, a pin that goes stale here produces false-positive staleness warnings for users who already have a newer, correct rev. Re-verify these pins periodically (e.g. against each repo's latest release tag). When in doubt, treat `pre-commit autoupdate`'s own output as the authoritative staleness signal, not a mismatch against this table.
|
||||
|
||||
Reference in New Issue
Block a user