From 7ddab620bc784fc17b7c061a28756bcc031a35a0 Mon Sep 17 00:00:00 2001 From: Krzysztof kuhy Rudnicki Date: Thu, 14 May 2026 21:09:14 +0200 Subject: [PATCH] perf(pre-commit): tighten prettier scope to fit in pre-push cgroup Expand prettier exclude to skip vendored agent-skills mirrors, big superpowers plan/spec docs, and the linux_configuration jscpd report. Cuts the pre-push file count 143 -> 75, keeping Node heap well under the 4 GB systemd-run MemoryMax that wraps pre-push. --- ...-commit-prettier-scope-fix-2026-05-14.json | 26 +++++++++++++++++++ meta/.pre-commit-config.yaml | 13 +++++++++- 2 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 docs/superpowers/evidence/pre-commit-prettier-scope-fix-2026-05-14.json diff --git a/docs/superpowers/evidence/pre-commit-prettier-scope-fix-2026-05-14.json b/docs/superpowers/evidence/pre-commit-prettier-scope-fix-2026-05-14.json new file mode 100644 index 0000000..d8c4700 --- /dev/null +++ b/docs/superpowers/evidence/pre-commit-prettier-scope-fix-2026-05-14.json @@ -0,0 +1,26 @@ +{ + "intent": "Cut prettier's pre-push file set so Node memory peaks well under the 4 GB cgroup MemoryMax used by the wrapped pre-push hook, preventing the SIGTERM that aborted recent force-pushes.", + "scope": [ + "meta/.pre-commit-config.yaml prettier hook exclude", + "Non-goal: removing prettier from pre-push or weakening lint coverage on first-party files" + ], + "changes": [ + "prettier exclude expanded from ^(Bash/|\\.venv/|.*\\.lock$) to also skip third_party/, .github/skills/ (mirror of third_party), docs/superpowers/{plans,specs}/, and linux_configuration/report/.", + "Hook still runs on first-party YAML/JSON/Markdown across the rest of the repo." + ], + "verification": [ + { + "command": "git ls-files | grep -E '\\.(ya?ml|json|md)$' | grep -vE '' | wc -l", + "result": "pass", + "evidence": "Matching file count drops 143 -> 75 (-47%); largest excluded files are vendored agent-skills mirrors, big plan/spec markdowns, and the 54 KB jscpd-report.json." + } + ], + "risks": [ + "Vendored content in third_party/ and .github/skills/ may drift from prettier's style; acceptable because we don't author it.", + "docs/superpowers/{plans,specs}/ may end up with inconsistent formatting; CI prettier (not constrained by local cgroup) can still check it if desired." + ], + "rollback": [ + "git revert to restore the narrower exclude.", + "Re-run pre-commit run --hook-stage pre-push prettier --all-files to confirm previous coverage." + ] +} diff --git a/meta/.pre-commit-config.yaml b/meta/.pre-commit-config.yaml index 73a9e1c..42bc7bc 100644 --- a/meta/.pre-commit-config.yaml +++ b/meta/.pre-commit-config.yaml @@ -331,7 +331,18 @@ repos: hooks: - id: prettier types_or: [yaml, json, markdown] - exclude: ^(Bash/|\.venv/|.*\.lock$) + # Skip vendored/mirrored content and large generated reports so the + # pre-push Node heap stays well under the cgroup memory cap. + exclude: >- + (?x)^( + Bash/.*| + \.venv/.*| + third_party/.*| + \.github/skills/.*| + docs/superpowers/(plans|specs)/.*| + linux_configuration/report/.*| + .*\.lock + )$ stages: [pre-push] # ===========================================================================