Skip .copier-answers.yml in the scaffolded typos hook - #13
Merged
Merged
Conversation
The file is generated, and its `_commit` is whatever ref the last update resolved to. Between releases that is a git describe string rather than a plain tag, so it carries a run of raw hex — and a short hex run is a coin flip away from spelling something typos reads as a misspelling. One duly landed on main and failed the render job of template CI. Nothing in the file is prose, so checking it can only ever produce false positives, on a schedule nobody controls. Verified by rendering both variants at HEAD and running each scaffold's full pre-commit stack: all hooks pass. Then, on a rendered app with `_commit` forced to the exact value that broke CI, typos passes with the exclude and fails without it. The comment deliberately does not quote a real example, which would trip the hook in this file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
Fixes the red
Render and validate both variantsjob on main (run 31150433393):Why it happens
Template CI renders each variant with
--vcs-ref=HEADand runs the rendered scaffold's own pre-commit stack._commitis whatevergit describereturns for that ref — a plain tag only when HEAD is exactly a release commit, otherwise a describe string carrying raw hex, or a bare short SHA.A short hex run is a coin flip away from spelling something typos treats as a misspelled word.
ba338eftokenises toba, which typos wants to correct toby/be. Nothing in the file is prose, so checking it can only ever produce false positives — and which commits trigger one is pure chance, so this recurs unpredictably.Consumers are exposed too, though less often: their
_commitis normally a tag, but any project updated with--vcs-refpointing at a branch or SHA carries the same landmine.What changed
template/.pre-commit-config.yaml.jinja:exclude: ^\.copier-answers\.yml$on the typos hook.CHANGELOG.md: entry under[Unreleased]→Fixed.Verification
appandlibraryvariants at HEAD and ran each scaffold's complete pre-commit stack — all 14 hooks pass in both._commitforced back to the exact value that broke CI, typos passes with the exclude and fails without it (removed the line and re-ran as a control).Notes
.pre-commit-config.yamlitself isn't excluded, so a SHA quoted there gets spell-checked. Worth preserving that constraint if anyone edits the comment.ba338eftoday produces_commit: v1.8.1, because the annotated tag now sits on that commit. The original failure was transient in that sense — but it recurs for any merge to main that lands before the next release is tagged, which is most of them.copier update --defaults --trust --vcs-ref v1against the real remote, in a consumer checkout at_commit: v1.7.0, now reportsUpdating to template version 1.8.1.git describe --tagsat main's tip answersv1.8.1, so the annotate step did its job on the 1.8.1 release.Generated by Claude Code