Tune codespell config and fix typos#68
Open
yarikoptic wants to merge 3 commits into
Open
Conversation
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>
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.
The goal was to make it possible to use
codespelldirectly in the shell, thus configuration should be in "default" to it location. For my othercodespellcontributions 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.