Add codespell support with configuration and fixes - #21
Open
yarikoptic wants to merge 7 commits into
Open
Conversation
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>
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.
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
permissionsset only toreadso also should be safe.Changes
Configuration & Infrastructure
[tool.codespell]section inpyproject.tomlwith skip patterns andcheck-hidden = true..github/workflows/codespell.ymlrunning on pushes and PRs tomain, usingcodespell-project/actions-codespellpinned by SHA..git,.git-meta,.gitignore,.gitattributes,*.pdf,*.svg.Domain-Specific Whitelist
Added one legitimate term to
ignore-words-list:eto— ontology id used intests/configs/test-edit-obo.yaml(codespell would otherwise suggestto/ego/veto/wto).Ambiguous typos fixed manually (context review)
src/incatools/odk/model.py:926—remaning→remaining(docstring: "impact any remaining use of OWLTools").src/incatools/odk/templates/_dynamic_documentation.jinja2:716—fo→to("when adding the component to the ODK configuration file").Non-ambiguous typos fixed automatically (
codespell -w)Reproducibly via
datalad run(see commit7e0d44d). Notable ones:prefered→preferred,accomodates→accommodates,overriden→overridden,instanciate(d)→instantiate(d).Informations/informations→Information/information(docstrings & help text indownload.py,helper.py).editted→edited,offical→official,updateing→updating,re-use→reuse,multile→multiple,commmand→command,inofficial→unofficial,superceded→superseded,perfoming→performing.Extended-dictionary follow-up pass
Ran
codespell --builtin clear,rare,usage,code,namesand found one further real typo:src/incatools/odk/templates/_dynamic_documentation.jinja2:409—dont→don'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:189hadcan accomodatesbefore this PR. Codespell only corrected the spelling (→can accommodates), which left the grammar broken, so the sentence was tweaked tocan 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 codespellpasses with zero errors on the default builtins after all fixes.Generated with Claude Code and love to typos free code.