Repository navigation
Description
Agent Brief
Type: Task
Summary: Move the staged_gone check that seven formatter git-hooks repeat into the canonical lib/git-hooks/check-lib.sh as checks_staged_gone, and switch the four actionlint, bash-format, biome-format and go-format hooks to it; part 2 switches the other three (part of restructuring pass #14381).
Current behavior:
Seven hooks define the same 4-line staged_gone <path> under the same 2-line comment: 0 at pre-commit when the path is gone from the work tree and the index holds it as a regular file. Each calls it once:
plugins/actionlint/git-hooks/actionlint-check.sh:38-43, called at:54plugins/bash-format/git-hooks/shell-check.sh:56-61, called at:73plugins/biome-format/git-hooks/biome-check.sh:66-71, called at:92plugins/go-format/git-hooks/goimports-format.sh:72-77, called at:90plugins/markdown-format/git-hooks/markdown-check.sh:72-77,plugins/powershell-format/git-hooks/powershell-check.sh:76-81andplugins/ruff-format/git-hooks/ruff-check.sh:83-88(part 2)
Every hook already sources check-lib.sh, from beside it or from ../lib/git-hooks/ (actionlint-check.sh:24-32), and staged_gone reads CHECKS_MODE, which that library sets (lib/git-hooks/check-lib.sh:143-150). The library already holds the sibling test checks_partly_staged (:544-554), listed in its function index (:50). The installer writes check-lib.sh beside each installed hook in a directory per plugin (lib/git-hooks/install.mjs:990-994,1051), so an installed hook and its library come from the same release.
Desired behavior:
lib/git-hooks/check-lib.shdefineschecks_staged_gone <path>with the same body, besidechecks_partly_staged, and its function index names it besidechecks_partly_staged.scripts/sync-shared-copies.shregenerates the ten plugin copies ofcheck-lib.sh(scripts/shared-copies.txt:624-633).- The four hooks above delete their comment and definition and call
checks_staged_gone. - The three hooks of part 2 keep their own
staged_goneuntil part 2; the new name does not collide with it.
Files:
lib/git-hooks/check-lib.shplugins/actionlint/git-hooks/actionlint-check.shplugins/bash-format/git-hooks/shell-check.shplugins/biome-format/git-hooks/biome-check.shplugins/go-format/git-hooks/goimports-format.shplugins/<plugin>/lib/git-hooks/check-lib.sh(generated) for typos-format, ruff-format, bash-format, biome-format, go-format, markdown-format, powershell-format, actionlint, guardrails and instruction-placement- a new
patchfragment in.changes/<plugin>/for each of those ten plugins:### Changed, "Internal restructuring, no behavior change."
Key interfaces:
- Each hook's arguments, output, exit codes and messages: unchanged.
- No test names
staged_gone;lib/git-hooks/check-lib.test.sh:72-77testschecks_partly_stagedby name, and no test pins the library's function list.
Acceptance criteria:
-
checks_staged_goneis defined once, inlib/git-hooks/check-lib.sh, and the four hooks call it with no local copy. - Behavior is unchanged: the same outputs, exit codes and printed results for the same inputs.
- The diff edits only the listed files and the lines of a test that assert on them when the change breaks that assertion.
- The pull request stays within 400 changed lines, not counting regenerated copies, and 15 hand-edited files.
-
scripts/sync-shared-copies.sh --checkandscripts/sync-shared-copies.sh --check-bump origin/mainpass. -
lib/git-hooks/check-lib.test.sh,actionlint-check.test.sh,shell-check.test.sh,biome-check.test.shandgoimports-format.test.shpass. - ci-status is green.
Out of scope:
- The markdown-format, powershell-format and ruff-format hooks (part 2), each hook's batch loop, other duplication, eval cases, fixtures, and skill and agent text.
Metadata
Metadata
Assignees
Labels
Type
Fields
Work status
Priority
Activity
melodic-automation-lanes commentedon Nov 12, 2026
{"v":1,"actor_id":337595936,"title_sha256":"65657c75d1f60c13715603c682f71a7562d5da16bb9844f55a487cc3a9494fd7","body_sha256":"85de10906b1eaeb706b700be8f50b219573a8e86da7f699c285a0f6b1b7ddf1e"}
github-actions commentedon Nov 12, 2026