docs(pc-skills): trim generic pre-commit boilerplate (finding 38)
Collapse the per-language hook tables in pc-author's hooks-by-language.md into one shared-repo table plus an "other repos" table, dropping the repeated repo/rev/rationale text that just restated what each hook does. 128 -> 92 lines. Kept both "Unverified — not in research corpus" flags and the rev-freshness caveat. Remove the generic SSH/proxy CI failure sections, the shellcheck SC-code listing, and compress the generic validate-config schema-error bullets in pc-run's failure-patterns.md, all of which just restated pre-commit.com's own docs. 133 -> 109 lines. Kept the rtk-prefixed re-stage/recommit fix (ADR-0023), the "do NOT reach for `pre-commit install -f`" warning, and both gitleaks/shellcheck not-sourced-from-corpus notes. Combined cut: 60 lines. Flat mirrors regenerated via scripts/sync-plugin-content.sh and verified byte-identical (--check exits 0); no plugin.json drift. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YR2CjVumUbEGWcMikcoXBD
This commit is contained in:
@@ -36,10 +36,7 @@ Suggestions:
|
||||
|
||||
Cause: shellcheck found a shell script issue. The output includes the file path, line number, and SC-code.
|
||||
|
||||
Fix: Look up the SC-code on shellcheck.net or pass `--explain SCxxxx` to shellcheck for a detailed explanation. The most common fixes:
|
||||
- SC2086 (unquoted variable): wrap in double quotes.
|
||||
- SC2046 (unquoted command substitution): wrap in double quotes.
|
||||
- SC2181 (check exit code of `$?`): use `if command; then` directly.
|
||||
Fix: Look up the SC-code on shellcheck.net or pass `--explain SCxxxx` to shellcheck for a detailed explanation.
|
||||
|
||||
## `check-hooks-apply` fails
|
||||
|
||||
@@ -53,23 +50,6 @@ Cause: An `exclude` pattern matches no files.
|
||||
|
||||
Fix: Remove or fix the pattern.
|
||||
|
||||
## SSH cloning fails in CI
|
||||
|
||||
Cause: The CI environment lacks SSH credentials to clone hook repos over SSH.
|
||||
|
||||
Fix: Export `SSH_AUTH_SOCK` in the CI environment, or switch hook repo URLs to HTTPS.
|
||||
|
||||
## HTTP proxy needed
|
||||
|
||||
Cause: The CI/sandbox network requires a proxy to reach hook repos.
|
||||
|
||||
Fix:
|
||||
```bash
|
||||
export http_proxy=http://proxy.example.com:3128
|
||||
export https_proxy=http://proxy.example.com:3128
|
||||
export no_proxy=localhost,127.0.0.1
|
||||
```
|
||||
|
||||
## `rev` is a branch name — `autoupdate` broke it
|
||||
|
||||
Cause: Branch refs are mutable and drift over time; pre-commit resolves them once at install time, so pinning to a branch name (instead of a tag or commit SHA) leads to silent version drift.
|
||||
@@ -126,8 +106,4 @@ Or add `default_install_hook_types` to `.pre-commit-config.yaml` and re-run `pre
|
||||
|
||||
## `validate-config` schema error
|
||||
|
||||
Common causes:
|
||||
- Missing `id` under a hook block
|
||||
- Missing `rev` under a non-local repo block
|
||||
- `repo: local` hook missing `language` or `entry`
|
||||
- Indentation error (valid YAML but invalid pre-commit schema)
|
||||
Common causes: missing `id` under a hook block, missing `rev` under a non-local repo block, a `repo: local` hook missing `language` or `entry`, or an indentation error (valid YAML but invalid pre-commit schema).
|
||||
|
||||
Reference in New Issue
Block a user