Skip to content

Tune codespell config and fix typos#68

Open
yarikoptic wants to merge 3 commits into
EpicGames:mainfrom
yarikoptic:enh-codespell
Open

Tune codespell config and fix typos#68
yarikoptic wants to merge 3 commits into
EpicGames:mainfrom
yarikoptic:enh-codespell

Conversation

@yarikoptic

Copy link
Copy Markdown

The goal was to make it possible to use codespell directly in the shell, thus configuration should be in "default" to it location. For my other codespell contributions see https://github.com/yarikoptic/improveit-dashboard/blob/master/READMEs/yarikoptic.md and there on.

AI disclosure

Per CONTRIBUTING.md: Claude Code (Opus 4.7) was used to draft the config changes and identify the typos / false positives; all decisions were reviewed and the PR description here is to be rewritten by the author.

yarikoptic and others added 3 commits June 21, 2026 23:06
Move the inline `-L` / `-S` arguments out of `.pre-commit-config.yaml`
and into the central `[tool.codespell]` section of `pyproject.toml` so
that every runner (pre-commit, direct `codespell` invocation, CI) reads
the same configuration. Previously, the inline `-S Cargo.*,vendor/*`
masked vendored-code typos that a direct `codespell` run would have
surfaced.

Other changes:

- Skip `*/thirdparty/*` (vendored native code like rpmalloc has its
  own typos) and `*/vale/styles/*` (Vale rules use deliberate
  word-fragment patterns like `lication`).
- Add documenting comments explaining why each ignored word is
  whitelisted (Rust keyword, library name, surname, French loanword,
  mathematical term, etc.).
- Add `pathC`/`subB`-style camelCase regex so test path components
  don't get flagged.
- Add an `exclude:` regex on the pre-commit hook to mirror the central
  `skip` patterns — pre-commit passes file paths explicitly, which
  bypasses codespell's own skip handling.
- Bump the codespell pre-commit hook from `v2.2.4` to `v2.4.2`.

Signed-off-by: Yaroslav Halchenko <debian@onerussian.com>
Co-Authored-By: Claude Code 2.1.138 / Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Real typos:

- lore-server/src/settings.rs: "sits infront of" -> "sits in front of"
- lore-revision/src/nametable.rs: "rebuiling" -> "rebuilding"
  (in a TODO comment about garbage-collecting the nametable)

Style normalisation (codespell prefers the closed form, both are
valid English):

- lore-server/build.rs: "re-declared" -> "redeclared"
- docs/.../canon/doc-types.md: "re-use" -> "reuse"
- docs/.../operational/review-checklist.md: "re-used" -> "reused"

Intentional test-fixture typos in `scripts/test/test_conflict.py`
(the test deliberately writes "conflic" to exercise merge-conflict
behaviour against a later "conflict" fix) are protected with inline
`# codespell:ignore conflic` pragmas rather than whitelisted globally,
so future genuine misspellings of "conflict" still get flagged.

Signed-off-by: Yaroslav Halchenko <debian@onerussian.com>
Co-Authored-By: Claude Code 2.1.138 / Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant