Skip to content

Add codespell support with configuration and fixes#1314

Open
yarikoptic wants to merge 5 commits into
git-ai-project:mainfrom
yarikoptic:enh-codespell
Open

Add codespell support with configuration and fixes#1314
yarikoptic wants to merge 5 commits into
git-ai-project:mainfrom
yarikoptic:enh-codespell

Conversation

@yarikoptic
Copy link
Copy Markdown

@yarikoptic yarikoptic commented May 8, 2026

Add codespell configuration and fix existing typos. AI is great, but old deterministic code has still its function! ;)

More about codespell: https://github.com/codespell-project/codespell

I personally introduced it to over a hundred projects already mostly with positive feedback (see "improveit-dashboard").

CI workflow has permissions set only to read so should be safe.

Changes

Configuration & Infrastructure

  • .codespellrc with skip patterns for binary/data files and a curated ignore-words-list for domain-specific terms
  • .github/workflows/codespell.yml runs codespell on push and pull_request to main (read-only permissions, pinned to commit SHA)

Skip patterns

*/secrets.rssrc/authorship/secrets.rs holds a hardcoded BIGRAMS table of 2-letter byte literals (b"te", b"nd", b"ue", ...) used to discriminate random strings from natural code; every entry trips codespell.

*/example-claude-code.jsonl, */windsurf-session-simple.jsonl — captured agent transcripts in tests/fixtures/ containing intentional typos (fake user input like "Eraase rewrite you cand o bettter") and truncated text used as test data.

Domain-specific whitelist

  • caf — "café" rendered via Latin-1/UTF-8 escape sequences in tests (e.g. b"caf\xe9")
  • ratatui — Rust TUI library (Cargo dependency)
  • juxt — JS functional helper name (juxtapose) used in test fixtures
  • serserde::ser module
  • statics — test variable holding a src/static_files.rs filename handle
  • nam — "Việt Nam" in test data for non-ASCII filenames
  • vas — "VirtualAttributions" abbreviation used throughout authorship code
  • fo — Windows tasklist /FO output-format flag
  • ue — test variable holding a util_e.py filename handle
  • afile — Vim autocmd built-in <afile> (current buffer file)

Typo fixes

Ambiguous (1 fix, manual)

  • runingrunning (AGENTS.md / symlinked CLAUDE.md, Taskfile.yml) — codespell suggested both running and ruining; context "approaches for runing git-ai locally" makes running clearly correct

Non-ambiguous (8 fixes via codespell -w)

  • tahtthat (AGENTS.md)
  • foramtformat (docs/migrations/sessions-v2-note-format.md)
  • writenwritten (src/authorship/attribution_tracker.rs doc comment)
  • regualarregular (src/authorship/rebase_authorship.rs comment)
  • AmmendedAmended (src/authorship/rebase_authorship.rs tracing::debug! log message)
  • PersistancePersistence ×2 (src/git/repo_storage.rs block comments)
  • versinoversion (tests/integration/git_cli_arg_parsing.rs test comment, already aligned with the live assertion)
  • nonexistantnonexistent (tests/integration/gix_config_tests.rs regex pattern in a _no_matches test where the pattern only needs to not match anything)

Non-ambiguous fixes were committed via datalad run 'codespell -w' so the command and outputs are recorded in the commit and re-runnable with datalad rerun.

Historical context

This project has had ~11 prior commits matching typo/spell in their subject (e.g. "Fix typo commiting->committing in stats", "Add errata for field name typo in v3.0.0"), so automated checking is well justified.

Testing

uvx codespell passes cleanly (exit 0) after all fixes.


🤖 Generated with Claude Code and love to typos free code


Open in Devin Review

yarikoptic and others added 5 commits May 7, 2026 16:13
Add skip entries for files where codespell hits are inherent to the
content rather than typos:
- src/authorship/secrets.rs holds a hardcoded BIGRAMS table of 2-letter
  byte literals (te, nd, ue, ot, Te, fo, TE, ...) used to discriminate
  random strings from natural code; every entry trips codespell.
- tests/fixtures/example-claude-code.jsonl and
  tests/fixtures/windsurf-session-simple.jsonl are captured agent
  transcripts containing intentional typos (fake user input) and
  truncated text used as test data.

Add ignore-words-list for legitimate identifiers and abbreviations
that codespell flags as typos: caf (café in escape sequences),
ratatui (Rust TUI dep), juxt (JS functional helper), ser (serde::ser),
statics / ue / nam (test variable + Vietnamese country name), vas
(VirtualAttributions abbreviation), fo (Windows tasklist /FO flag),
afile (Vim autocmd <afile> built-in).

Co-Authored-By: Claude Code 2.1.133 / Claude Opus 4.7 (1M context) <noreply@anthropic.com>
codespell suggests "runing ==> running, ruining". The surrounding
context ("approaches for runing git-ai locally") makes "running" the
clear correct fix in both AGENTS.md (symlinked from CLAUDE.md) and
Taskfile.yml.

Co-Authored-By: Claude Code 2.1.133 / Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Fixed via `codespell -w`:
- taht -> that (AGENTS.md / CLAUDE.md symlink)
- foramt -> format (docs/migrations/sessions-v2-note-format.md)
- writen -> written (src/authorship/attribution_tracker.rs)
- regualar -> regular (src/authorship/rebase_authorship.rs comment)
- Ammended -> Amended (src/authorship/rebase_authorship.rs debug log)
- Persistance -> Persistence (src/git/repo_storage.rs, x2)
- versino -> version (tests/integration/git_cli_arg_parsing.rs)
- nonexistant -> nonexistent (tests/integration/gix_config_tests.rs)

Co-Authored-By: Claude Code 2.1.133 / Claude Opus 4.7 (1M context) <noreply@anthropic.com>

=== Do not change lines below ===
{
 "chain": [],
 "cmd": "uvx codespell -w",
 "exit": 0,
 "extra_inputs": [],
 "inputs": [],
 "outputs": [],
 "pwd": "."
}
^^^ Do not change lines above ^^^
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented May 8, 2026

CLA assistant check
All committers have signed the CLA.

Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 2 additional findings.

Open in Devin Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants