fix(typos-format): remove opt-in config-gate, run unconditionally - #900
Conversation
typos ships a built-in spelling dictionary and needs no configuration to be useful, so gating the hook on a consumer typos config existing made it a silent no-op on exactly the zero-config repos it was meant to help. Run `typos --write-changes` unconditionally on every edit, matching `markdown-format`'s existing unconditional pattern. A consumer typos config, when present, is still discovered and honored automatically by typos itself. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K1V3gkrfSf75isB8MiDy3o
|
Claude finished @kyle-sexton's task in 2m 43s —— View job Security Review — PR #900
|
|
Claude finished @kyle-sexton's task in 1m 50s —— View job PR Review: fix(typos-format): remove opt-in config-gate, run unconditionally
SummaryThe core change is correct and well-motivated. Findings1. Stale "Case 3" cross-reference in test header — MINOR The test file's opening comment (line 14) says "Case 3 below locks this in" to document that typos resolves config relative to the target path, not the process CWD. After renumbering, that test is now Case 5 ("config nested BELOW repo root"). The test itself is correct; the comment cross-reference is stale. -# target path passed on the command line, not the process CWD — Case 3 below
+# target path passed on the command line, not the process CWD — Case 5 below2. KNOWN RISK comment overstates the triggering condition — MINOR The comment reads "on a repo with both a typos config and (e.g.) a Ruff config". Since the hook now runs unconditionally, the concurrent-write race with sibling formatter hooks applies regardless of whether the repo has a typos config — the co-condition is just "both plugins are installed and the file is edited". The risk itself is correctly described; only the triggering condition language is slightly stale. What's correct and well-done
Two minor fixes needed (one stale comment cross-reference, one comment-only nit). No correctness, security, or functional issues found. |
|
Post-green review classification (work lane):
No DEFER-FORBIDDEN class applies. No inline review threads to resolve (PR-level comments only). Duplicate PR #901 (an independent parallel implementation of the same fix) closed as superseded — this one landed first with a clean review and zero pending checks. Flipping to ready, handing off to the babysit lane for ongoing watch. |
|
Claude finished @kyle-sexton's task in 2m 36s —— View job PR Review: fix(typos-format): remove opt-in config-gate, run unconditionally
SummaryThe fix is correct and well-motivated. Hook Script —
|
| File | Change | Assessment |
|---|---|---|
plugin.json |
Version 0.1.0 → 0.2.0; description updated | ✓ Appropriate — visible behavioral change |
CHANGELOG.md |
0.2.0 entry added | ✓ Accurate and well-written |
plugins/typos-format/README.md |
Behavior + Requirements rewritten | ✓ Consistent with new behavior; config requirement correctly removed from Requirements |
README.md (top-level) |
Plugin description updated | ✓ One-liner consistent with others |
skills/setup/SKILL.md |
Step 3 FAIL condition simplified; Step 4 changed to INFO-only | ✓ Config check correctly demoted from gate to informational |
CLAUDE.md Alignment
| Requirement | Status |
|---|---|
| Repo-agnostic (no hardcoded paths) | ✓ |
Configurable via userConfig |
✓ typos_format_enabled kill-switch intact |
Plugin-form-safe (no ../ reach-outs) |
✓ |
| No PII / secrets | ✓ |
| Versioned with explicit semver | ✓ 0.2.0 |
| Security-reviewed | ✓ Prior review in this PR: no issues found |
Verdict
Approve. The behavioral fix is correct, the implementation is minimal and clean, and the documentation and test suite are updated consistently across all 7 files. Two minor comment-only issues from prior reviews (stale "Case 3" cross-reference, KNOWN RISK trigger wording) are non-blocking and were deliberately left by the author. No correctness, security, or functional issues.
|
Claude finished @kyle-sexton's task in 1m 58s —— View job Security Review — PR #900
No security issues found. All 7 changed files reviewed against: command/path/JSON injection, unsafe shell expansion, secrets/credential handling, permission widening, supply-chain risk, and dangerous GitHub Actions patterns. Hook script:
|

Summary
typos-format's hook only rantypos --write-changeswhen the consuming repo already had atypos.toml/_typos.toml/.typos.toml/Cargo.toml([*.metadata.typos])/pyproject.toml([tool.typos]) file present.typosships a built-in spelling dictionary and runs standalone with zero configuration — a repo config only widens the allowlist/exclude list, it is not an activation switch. The gate made the hook a silent no-op on exactly the zero-config repos it was meant to help, defeating the plugin's purpose.Fix
Removed the opt-in config-gate (and its ancestor-walk grep logic) entirely.
typos --write-changes --force-excludenow runs unconditionally on every edit, matchingmarkdown-format's existing unconditional pattern.typos's own file-anchored config discovery still applies automatically when a config IS present (allowlist/exclude, precedence order) — the hook never re-implemented that discovery and still doesn't; only the activation gate is gone.Also updated: plugin manifest description/version, README (top-level + plugin), CHANGELOG, the
setupskill'scheckstep (config presence is now reported as informational only, never a gate), and the test suite (the old "gate OFF -> file left untouched" case is replaced with "runs unconditionally, fixes a real typo with no config present anywhere").Verification
Empirical before/after on an isolated zero-config git repo (
this document has a recieve typo, notypos.toml/_typos.toml/.typos.toml/Cargo.toml/pyproject.tomlanywhere in the ancestor chain):origin/main's gated hook): file left untouched —recieveunfixed, hook exits silently.recieve→receive.Full test suite:
bash plugins/typos-format/hooks/typos-format.test.sh— 41/41 passing, including the new unconditional-fix case, kill-switch, residual-findings, exclude, and telemetry cases.Closes #884
Related
typos-format's andruff-format's opt-in-gate grep. docs(ruff-format): document TOML inline-table opt-in-gate limitation #896 already closed it for theruff-formathalf (documented as a known limitation there). Thetypos-formathalf is now moot: this PR deletes the opt-in gate and its grep entirely, so there is no gate left for that detection gap to affect.Co-Authored-By: Claude Sonnet 5 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01K1V3gkrfSf75isB8MiDy3o