Skip to content

Add codespell support with configuration and fixes - #21

Open
yarikoptic wants to merge 7 commits into
INCATools:mainfrom
yarikoptic:enh-codespell
Open

Add codespell support with configuration and fixes#21
yarikoptic wants to merge 7 commits into
INCATools:mainfrom
yarikoptic:enh-codespell

Conversation

@yarikoptic

Copy link
Copy Markdown

Add codespell configuration and fix existing typos.

Original motivation: obophenotype/uberon#3759 — codespell fixes in Uberon surfaced typos originating from ODK templates, so it makes sense to add codespell here at the source.

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

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

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

Changes

Configuration & Infrastructure

  • Added [tool.codespell] section in pyproject.toml with skip patterns and check-hidden = true.
  • Added GitHub Actions workflow .github/workflows/codespell.yml running on pushes and PRs to main, using codespell-project/actions-codespell pinned by SHA.
  • Skip list: .git,.git-meta,.gitignore,.gitattributes,*.pdf,*.svg.

Domain-Specific Whitelist

Added one legitimate term to ignore-words-list:

  • eto — ontology id used in tests/configs/test-edit-obo.yaml (codespell would otherwise suggest to/ego/veto/wto).

Ambiguous typos fixed manually (context review)

  • src/incatools/odk/model.py:926remaningremaining (docstring: "impact any remaining use of OWLTools").
  • src/incatools/odk/templates/_dynamic_documentation.jinja2:716foto ("when adding the component to the ODK configuration file").

Non-ambiguous typos fixed automatically (codespell -w)

Reproducibly via datalad run (see commit 7e0d44d). Notable ones:

  • preferedpreferred, accomodatesaccommodates, overridenoverridden, instanciate(d)instantiate(d).
  • Informations/informationsInformation/information (docstrings & help text in download.py, helper.py).
  • edittededited, officalofficial, updateingupdating, re-usereuse, multilemultiple, commmandcommand, inofficialunofficial, supercededsuperseded, perfomingperforming.

Extended-dictionary follow-up pass

Ran codespell --builtin clear,rare,usage,code,names and found one further real typo:

  • src/incatools/odk/templates/_dynamic_documentation.jinja2:409dontdon't.

Other extended-pass hits were legitimate and intentionally left alone:

  • ro/RO — the Relation Ontology identifier, used throughout examples and templates.
  • master, whitelist — inclusive-language concerns, out of scope for a spell-checking PR.

Pre-existing grammar tidy-up

src/incatools/odk/config.py:189 had can accomodates before this PR. Codespell only corrected the spelling (→ can accommodates), which left the grammar broken, so the sentence was tweaked to can accommodate the change.

Historical Context

This project has had prior commits manually fixing typos (Typo fix., Typo fixes., More typo fixes.), demonstrating the value of adding automated spell-checking to catch these earlier.

Testing

  • uvx codespell passes with zero errors on the default builtins after all fixes.

Generated with Claude Code and love to typos free code.

yarikoptic and others added 7 commits August 28, 2026 08:30
Skip: also .git-meta (author-workflow scratch), *.pdf, *.svg.
Whitelist: 'eto' — ontology id used in tests/configs/test-edit-obo.yaml
(codespell suggests to/ego/veto/wto).

Co-Authored-By: Claude Code 2.1.250 / Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- src/incatools/odk/model.py:926: remaning -> remaining
  (adjective before "use of OWLTools" in docstring)
- src/incatools/odk/templates/_dynamic_documentation.jinja2:716: fo -> to
  ("when adding the component to the ODK configuration file")

Co-Authored-By: Claude Code 2.1.250 / Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Fixed typos:
- accomodates -> accommodates (src/incatools/odk/config.py)
- prefered -> preferred (src/incatools/odk/cli.py)
- Informations/informations -> Information/information (src/incatools/odk/download.py, helper.py)
- overriden -> overridden (src/incatools/odk/{model,setup}.py, templates/src/ontology/Makefile.jinja2)
- instanciate/instanciated -> instantiate/instantiated (src/incatools/odk/template.py)
- editted -> edited (templates/CONTRIBUTING.md.jinja2)
- offical -> official (templates/CONTRIBUTING.md.jinja2)
- updateing -> updating (templates/_dynamic_documentation.jinja2)
- re-use -> reuse (templates/_dynamic_documentation.jinja2)
- multile -> multiple (templates/_dynamic_files.jinja2)
- commmand -> command (templates/src/ontology/Makefile.jinja2)
- inofficial -> unofficial (templates/src/ontology/Makefile.jinja2)
- superceded -> superseded (templates/src/ontology/README-editors.md.jinja2)
- perfoming -> performing (templates/src/sparql/README.md.jinja2)

Co-Authored-By: Claude Code 2.1.250 / 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 ^^^
- src/incatools/odk/templates/_dynamic_documentation.jinja2:409:
  dont -> don't ("If you don't have it yet, ...")

Found via `codespell --builtin clear,rare,usage,code,names`. Other hits
from that pass were legitimate (`ro`/`RO` = Relation Ontology; `master`
and `whitelist` are inclusive-language concerns out of scope here).

Co-Authored-By: Claude Code 2.1.250 / 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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant