Skip to content

Add codespell support with configuration and fixes#1028

Open
yarikoptic wants to merge 5 commits intoPagefind:mainfrom
yarikoptic:enh-codespell
Open

Add codespell support with configuration and fixes#1028
yarikoptic wants to merge 5 commits intoPagefind:mainfrom
yarikoptic:enh-codespell

Conversation

@yarikoptic
Copy link

Add codespell configuration and fix existing typos.

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

I personally introduced it to dozens if not hundreds of projects already and so far only positive feedback.

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

Changes

Configuration & Infrastructure

  • Added .codespellrc configuration with comprehensive skip patterns
  • Created GitHub Actions workflow to check spelling on push and PRs

Skip Patterns

Configured to skip directories/files that produce false positives:

  • snowball — Snowball stemmer algorithm code (linguistic suffix patterns like ket, amongs)
  • translations — i18n files with foreign language words
  • integration_tests — test data with intentional partial words (worl, Nam, Resul)
  • gz.js — vendored fflate compression library
  • .npm, .cache — local caches
  • *.svg, *.css, *.lock, etc. — binary/generated files

Domain-Specific Whitelist

Added legitimate terms that codespell flags as typos:

  • caf — stemmed form of "café" (used in search indexing)
  • unparseable — widely used variant of "unparsable"
  • varius — Latin lorem ipsum text in test data

Typo Fixes

Ambiguous typos fixed manually (2 fixes with context review):

  • bundingbundling (CHANGELOG.md — context: "bundling the UI JavaScript files")
  • orginaloriginal (Python wrapper — local variable name typo)

Non-ambiguous typos fixed automatically (8 fixes in 7 files):

  • StablizedStabilized (CHANGELOG.md)
  • UkranianUkrainian (CHANGELOG.md)
  • langaugelanguage (api.md, ui-usage.md)
  • paramatersparameters (ranking.md, lib.rs, index.d.ts)
  • WrappsWraps (pagefind_stem/src/lib.rs)

Historical Context

This project has had 19 prior commits fixing typos manually, demonstrating the value of automated spell-checking.

Testing

Codespell passes with zero errors after all fixes.


🤖 Generated with Claude Code and love to typos free code

Skip directories:
- snowball (Snowball stemmer algorithms - linguistic suffix patterns)
- translations (i18n files with foreign language words)
- integration_tests (test data with intentional partial words)
- gz.js (vendored fflate library)
- .npm, .cache (local caches)

Whitelist: caf (stemmed "café"), unparseable (valid variant), varius (Latin lorem ipsum)
- bunding -> bundling (CHANGELOG.md) - context: "bundling the UI JavaScript files"
- orginal -> original (wrappers/python) - local variable name typo
Fixed typos:
- Stablized -> Stabilized (CHANGELOG.md)
- Ukranian -> Ukrainian (CHANGELOG.md)
- langauge -> language (docs/content/docs/api.md, docs/content/docs/ui-usage.md)
- paramaters -> parameters (docs/content/docs/ranking.md, pagefind_web/src/lib.rs, pagefind_web_js/types/index.d.ts)
- Wrapps -> Wraps (pagefind_stem/src/lib.rs)

Command: uvx codespell -w
@yarikoptic yarikoptic requested a review from bglw as a code owner March 3, 2026 18:58
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.

1 participant