Name script/check as the gate repo-type verifications belong in #50
Reference in New Issue
Block a user
Delete Branch "policy/name-the-gate-for-repo-type-checks"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
SPECULATIVE and ahead of your ruling. One sentence of policy prose changed; no script, config or checklist is touched, and closing it costs nothing.
What the rule says now
prompts/REPO_POLICIES.mdline 72:> Repo-type-specific pre-commit extras (e.g.
go mod tidyverification in Go repos) belong inscript/precommit, not in the hook itself.The second half of that is right and stays: the git hook file is a shim, and the logic lives in
script/. The first half names the wrong script.script/precommitis one caller ofscript/check, not a gate. A verification placed there alone runs for a contributor who installed the hook and committed through it, and for nobody else:script/checkdoes not run it, and CI runsscript/cibuild(docker build .), which does not either. So the rule as written directs repo-type verifications to the single place in the entrypoint set where CI cannot see them, whilescript/check— which the Dockerfile build step runs, and whichscript/precommititself calls — is the place where one run covers every path.This is not a homoicon-specific observation, which is why it is filed here rather than patched into a vendored copy: the shape holds for every repo that adopts the scripts, because it follows from the entrypoint graph the policy itself defines (
script/checkrunstest/lint/fmt-check;script/precommitcallsscript/check; the Dockerfile runsmake check; the workflow runsscript/cibuild).The change
The read-only clause is there because the placement implies a constraint that has already caught one implementation out:
make checkmust not modify files (line 238 of this document), and the obvious way to verify tidiness — rungo mod tidy, thengit diff— violates that. Naming the gate without naming the constraint moves a file-rewriting command into a script that must not rewrite files.The alternative, and why not it
Option A (this PR): amend the text so it names the gate. The rule then matches what the entrypoint graph already makes true, and adopting repos get the check on every path including CI.
Option B: keep the text and move the gate back to
script/precommit. Rejected. It restores the exact defect — a rule enforced only by an optional local hook, invisible to CI — which is the failure mode several units in the consuming repos have spent effort closing. It would also mean the check is not run bymake check, so a contributor cannot verify locally what CI will judge them on. The only thing Option B buys is not editing this file, and it buys that by keeping a gate that reports success without having checked.There is no third option that keeps both halves:
script/precommitcannot be reached by CI without CI running the pre-commit hook, which is not what the workflow does.Provenance and current state, stated plainly
needs-reworkas of this writing), so in homoicon today the tidy check still lives inscript/precommitexactly as the current text says. The drift this fixes is prospective there, not landed. The argument for naming the gate does not depend on that PR: it holds for any repo, becausescript/precommitis off the CI path by construction.REPO_POLICIES.mdis byte-identical to this repo's canonical file onmain(sha256bcf11c312a1bee18a0e937eb412b51914411c1ab23308b8362409f3f88379ff7, 416 lines,diffclean), which is why the change is proposed here and nothing is edited downstream. Re-vendoring waits until this lands.Scope of the sweep
Grepped every
*.md, theMakefileand theDockerfilein this repo forgo mod tidyand forprecommit:prompts/REPO_POLICIES.md:72— the sentence changed here, the only statement of where such a check belongs.prompts/REPO_POLICIES.md:366— "Always rungo mod tidybefore committing": an instruction to the author, not a gate location. Unaffected and not contradicted.prompts/CODE_STYLEGUIDE_GO.md:462—go mod tidyin a getting-started walkthrough. Unaffected.prompts/REPO_POLICIES.md:65-66, 180-184,prompts/EXISTING_REPO_CHECKLIST.md:57,prompts/NEW_REPO_CHECKLIST.md:95-98,README.md:129-134— all state only thatscript/precommitis what the hook runs and that it callsscript/check. Still true, unchanged, and consistent with the new wording.Nothing else in the repo states either version of the rule, so nothing is left saying the other one.
The repo-root
REPO_POLICIES.mdis a symlink toprompts/REPO_POLICIES.md, so the single edit covers both paths.Note on the
nextbranchnext(six commits ahead ofmain, milestone PR #34) carries the same sentence, at its line 76, with different surrounding text. This PR is cut frommain, matching #49 and this repo'sTODO.mdworkflow. The hunks do not overlap the onesnextchanges, so a laternextmerge should carry this sentence through; if you would rather have it onnextinstead, say so and I will re-cut it there.Verification
script/cibuild(docker build ., which runsmake checkinside the image), exit 0. The check layer executed rather than being served from cache:#11 ... DONE 3.1s, withAll matched files use Prettier code style!from bothscript/lintandscript/fmt-checkin the log.make fmtproduced no further changes, so the new wording was already prettier-clean at 80 columns with 4-space tabs. The one dangling image the build produced was removed by id;docker ps -ais empty. No prune of any kind was run.last_modifiedin the front matter updated to 2026-08-20, per this file's own rule.Pull request closed