Skip to content

Centralize codespell config and add 1 more fix#1215

Open
yarikoptic wants to merge 3 commits intoharvard-edge:mainfrom
yarikoptic:enh-codespell
Open

Centralize codespell config and add 1 more fix#1215
yarikoptic wants to merge 3 commits intoharvard-edge:mainfrom
yarikoptic:enh-codespell

Conversation

@yarikoptic
Copy link

Made codespell to be usable standalone and aggregated and expanded its config.
Also found/fixed 1 extra typo

Changes

Configuration & Infrastructure

  • fa1130d Add github action to codespell main on push and PRs
  • 966990b Add rudimentary codespell config
  • 408c0a1 Consolidate codespell config into pyproject.toml for standalone use

What the consolidated config does

  • pyproject.toml is now the single source of truth — run codespell or uvx codespell standalone
  • Pre-commit hook updated to use pyproject.toml config (removed custom args overrides), bumped to v2.4.1
  • Removed .codespell-ignore-words.txt (had merge conflict markers; contents merged into pyproject.toml)

Skip patterns

  • *.bib (author surnames cause false positives), *.png (embedded text), *.scss
  • _extensions (third-party Quarto extension code with German variable names)
  • socratiQ (bundled JS), build outputs (_site, _book, htmlcov), caches (.cache, .npm)

Exclusions relaxed vs old pre-commit config

  • *.json — only .all-contributorsrc skipped now (not all JSON)
  • *.js — only socratiQ skipped now (not all JS)
  • *.tex — only _extensions skipped now (not all TeX)

Ignore patterns

  • camelCase/PascalCase regex for code identifiers (TikZ labels like ALine, LineZ, localY)
  • URL regex to protect links from corrections
  • 27 documented words in ignore-words-list (contributor names, abbreviations, domain terms)

Typo fix

  • akumulatorsaccumulators in inject_quizzes.lua

Testing

uvx codespell passes with zero errors


🤖 Generated with Claude Code

yarikoptic and others added 3 commits March 7, 2026 12:09
Refactor codespell setup so `codespell` (or `uvx codespell`) works
standalone without relying on pre-commit args or separate ignore files.

Config changes:
- Expanded skip patterns: *.bib (author names), *.png (embedded text),
  *.scss, _extensions (third-party Quarto code), socratiQ (bundled JS),
  build outputs (_site, _book, htmlcov), caches (.cache, .npm)
- Added ignore-regex for camelCase/PascalCase identifiers and URLs
- Added documented ignore-words-list for legitimate terms (contributor
  names, abbreviations, TikZ labels, domain terms)
- Removed .codespell-ignore-words.txt (had merge conflict markers;
  contents merged into pyproject.toml)

Relaxed exclusions (no longer blanket-skipped):
- *.json (only .all-contributorsrc skipped now)
- *.js (only socratiQ skipped now)
- *.tex (only _extensions skipped now)

Pre-commit: removed custom args/exclude overrides, bumped to v2.4.1,
now uses pyproject.toml config via tomli dependency.

Typo fix: akumulators → accumulators (inject_quizzes.lua comment)

Co-Authored-By: Claude Code 2.1.63 / Claude Opus 4.6 <noreply@anthropic.com>
@github-actions github-actions bot added area: tools Build tools, scripts, CI/CD type: improvement Improve existing content labels Mar 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: tools Build tools, scripts, CI/CD type: improvement Improve existing content

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant