Add codespell support: config, CI workflow, and false-positive guards - #617
Open
yarikoptic wants to merge 5 commits into
Open
Add codespell support: config, CI workflow, and false-positive guards#617yarikoptic wants to merge 5 commits into
yarikoptic wants to merge 5 commits into
Conversation
- Add `*/dist/*` and `*.min.js` to skip — the tracked `apps/gpgui-helper/dist/assets/main-*.js` is a built/minified bundle that triggers ~120 false positives on tokens like `te`, `fo`, `nd` which are normal in minified code. - Add `ignore-regex = https?://\S+` so codespell never "fixes" typos inside URLs (which would silently break links). Co-Authored-By: Claude Code 2.1.170 / Claude Opus 4.7 <noreply@anthropic.com>
- Bump `actions/checkout` to v6. - Pin `codespell-project/actions-codespell` to a specific SHA (v2.2), per supply-chain hygiene for third-party Actions. - Drop the separate `codespell-problem-matcher` step — annotation support is built into `actions-codespell@v2.2+`. Co-Authored-By: Claude Code 2.1.170 / Claude Opus 4.7 <noreply@anthropic.com>
The string `"fo"` in `it_should_not_redact_value` is deliberate test data verifying that values shorter than the redaction threshold are returned unchanged. codespell flags `fo` as a typo of `of`/`for`/... — guard the two occurrences with inline `// codespell:ignore fo` so the project-wide whitelist stays empty and future genuine typos of `fo` elsewhere are still caught. Co-Authored-By: Claude Code 2.1.170 / Claude Opus 4.7 <noreply@anthropic.com>
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.
Summary
Add codespell to catch typos in
sources and docs, and wire it into CI so future typos are caught at PR time.
This project has previously merged manual typo cleanups (e.g.
7bef2cc
Fix typos found by codespell (#234)) — automating the checkremoves the burden of remembering to run it.
I've introduced codespell into 100+ projects with mostly positive feedback
(see this writeup).
The CI workflow has
permissions: contents: readonly, so it's safe.Commits
Add github action to codespell main on push and PRsAdd rudimentary codespell configRefine codespell config: skip dist/ and minified JS, ignore URLsci(codespell): bump checkout to v6, pin codespell action by SHAtest(redact): mark intentional short test fixture for codespellPer-commit details
702e88d
Add github action to codespell main on push and PRs.github/workflows/codespell.ymlruns onpush/pull_requestagainstmain, withcontents: readonly.47ef75f
Add rudimentary codespell configInitial
.codespellrcwith a conservative skip list andcheck-hidden = true.06bada9
Refine codespell config: skip dist/ and minified JS, ignore URLs*/dist/*and*.min.js—apps/gpgui-helper/dist/assets/main-*.jsis a tracked, built/minified bundle that triggers ~120 false positives
(
te,fo,nd, …). The source lives inapps/gpgui-helper/src/andis still checked.
ignore-regex = https?://\S+so codespell never "corrects" typosinside URLs (would silently break links).
d622391
ci(codespell): bump checkout to v6, pin codespell action by SHAactions/checkoutto v6.codespell-project/actions-codespellto a SHA at v2.2 (supply-chain hygiene).codespell-problem-matcherstep — annotation support isbuilt into
actions-codespell@v2.2+, so the extra step is now redundant.b79bb6d
test(redact): mark intentional short test fixture for codespellcrates/gpapi/src/utils/redact.rs::it_should_not_redact_valueuses theliteral
"fo"to verify that values shorter than the redaction thresholdpass through unchanged. codespell flags
fo, so I added two inline// codespell:ignore fopragmas on the affected lines. This keeps theproject-wide
ignore-words-listempty — future genuine typos offoelsewhere will still be caught.
Testing
uvx codespellpasses with zero errors on this branchdist/bundles excluded from scanning (false-positive heavy)ignore-regex🤖 Generated with Claude Code and love to typo-free code