Add codespell support with configuration and typo fixes - #3759
Conversation
|
Thanks @yarikoptic! Still shilling for codespell hope you get a commission for all this 😉😉😉 ❤️ ❤️ ❤️ I believe some of these fixes are for derived docs eg from ODK. I think it's better to exclude some of these. The most valuable fixed are in the ontology source file. I'm unsure of the implications of a direct merge eg if we open ourselves to spurious PR blocks eg if we update ODK....? |
;) thanks for the ❤️s -- appreciated. Besides taming my now existent typosalergy, my evil underlying purpose is to run 'litmus testing' of "open" projects regarding contributions ;) some times responses do surprise me! also, with all the automation it is nearly as simple for me (or simpler since it right away creates a fork) to do it instead of plain
I would be happy to exclude whatever to be excluded. To not torture CI without need, I will wait for answers to your questions and any particular instructions on which ones to exclude since seems not having any particular 'auto-generated' marker in them like some others do for me to approach them systematically |
matentzn
left a comment
There was a problem hiding this comment.
Thank you @yarikoptic - As always, much appreciated.
| @@ -22119,7 +22119,7 @@ synonym: "distal tarsal 3 bone" EXACT SYSTEMATIC [UBERON:cjm] | |||
| synonym: "ectocuneiforme" EXACT [VSAO:0005054] | |||
| synonym: "external cuneiform" EXACT [Wikipedia:Lateral_cuneiform_bone] | |||
| synonym: "external cuneiform bone of foot" EXACT [] | |||
| synonym: "foor distal carpal bone 3" RELATED [] | |||
| synonym: "foot distal carpal bone 3" RELATED [] | |||
Extend the initial rudimentary .codespellrc so the check runs cleanly against the hand-curated parts of the repo. Following review feedback on obophenotype#3759 from @cmungall and @matentzn, this PR is deliberately scoped to infrastructure + typos in files that are safe to touch here; the uberon-edit.obo review and any odkcore-side fixes are deferred to separate PRs. Skip patterns: - Top-level release artifacts and derived directories (uberon.obo, uberon-base.owl, uberon-with-isa.obo, uberon-taxmod-*.obo, musculoskeletal.*, homology*, project.owl, reasoner_axioms.owl, rules.owl, ssso-merged-uberon.owl, depictions.owl, external-disjoints.owl; subsets/, imports/, taxmods/, diffs/, languages/). - source-ontologies/, resources/, ext-mappings/, mappings/, modules/ (external content); reports/, attic/, bulk_ntr_workflow/, experimental/ (archival / auto-generated / workflow scratch); docs/resources/ (binary graffle assets). - odk-workflows -- docs/odk-workflows/ is auto-generated from odkcore and any edit here would be lost on the next ODK refresh. Upstream fixes should go to https://github.com/INCATools/ontology-development-kit (per matentzn's review). - src/scripts/ubermacros.el -- ~196k-line auto-generated Emacs macros file indexing NCBITaxon species names. - uberon-bridge-to-*.owl, cl-bridge-to-*.owl (auto-generated by `refresh-bridges` via SSSOM inject). - definitions.owl (generated from src/patterns/data/**/*.tsv). - LICENSE (fixed legal wording). - .git-meta (author-workflow scratch for commit / PR message drafts). - uberon-edit.obo -- deferred to a separate curator-reviewed PR (per matentzn's review of obophenotype#3759, which noted the codespell -w pass produced several biological-context false positives that need domain expertise to distinguish from genuine typos). Protections via ignore-regex: - URLs (short host substrings like bu.edu would otherwise flag "bu"). - camelCase / PascalCase identifiers (Prolog vars, code identifiers). - Cross-reference values after PREFIX: (BAMS:MEnt, BM:Tel-OLT etc.). ignore-words-list (minimal, only what still-scanned files need): - Latin / anatomical: mater, vas, processus, regio, collum. - Ontology term: disjointness (as in "disjointness axiom"). - Code / data: anc, nd (Prolog predicates + GO evidence code "ND"), heterogenous, homogenous (accepted variants). Reduces codespell hits from ~13,600 lines of noise to ~45, all of which are real typos in still-in-scope files (handled in the next commits). Co-Authored-By: Claude Code 2.1.246 / Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Codespell flagged these with multiple possible corrections; each was
reviewed in context and fixed manually.
- reference/reference_0000034.md:166 "considere to be" -> "considered to be"
- reference/references-edit.omn:660 same fix (mirrored file)
- src/patterns/data/default/vein_and_venule_pattern.tsv:18
"A venous plexus tha connects" -> "that connects"
The corresponding "tha" in the auto-generated src/patterns/definitions.owl
will be corrected the next time the pattern is regenerated from the tsv.
Co-Authored-By: Claude Code 2.1.246 / Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Codespell auto-corrected 42 non-ambiguous typos (single-suggestion) across
docs/, reference/, src/scripts/, src/patterns/, src/ontology/Makefile and
uberon.Makefile, src/ontology/objectproperty.csv, uberon.references,
README-editors.txt, and src/sparql/README.md.
Common fixes: accomodate->accommodate, Hoever->However, prefered->preferred,
backtics->backticks, Examplar->Exemplar, analagous->analogous, eachother->
each other, frequence->frequency, informations->information, implmentation->
implementation, standarization->standardization, and other one-offs.
Co-Authored-By: Claude Code 2.1.246 / 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 ^^^
a9bd009 to
9e9b49c
Compare
|
@matentzn THANKS! I force pushed cleaned up changes. |
matentzn
left a comment
There was a problem hiding this comment.
Thank you @yarikoptic! I hope you will also do uberon-edit.obo and ODK next :P These are the biggest impact!
|
sure, next after this one is merged will be the note: 3 failing CI checks due to me submitting from a fork -- I do not think there is anything for me to address there but may be some one would be interested to resubmit from a branch within for better/fuller review etc. edit: or should I add more or restructure reference to the agentic assistance? |
Remove uberon-edit.obo from the codespell skip list. The previous PR (obophenotype#3759) deferred this file pending curator review of false positives. That review has now been done: 40+ domain-specific terms added to ignore-words-list, each with an inline comment in .codespellrc explaining why it is protected (Latin TA synonyms, anatomical abbreviations, intentional misspellings in RELATED synonyms, non-English words in citations, proper names). Co-Authored-By: Claude Code 2.1.251 / Claude Sonnet 4.6 <noreply@anthropic.com>
Add codespell configuration, CI check, and fix existing typos.
More about codespell: https://github.com/codespell-project/codespell — a spell-checker for source code that has been introduced to well over a hundred open-source projects with generally positive feedback.
The added CI workflow has
permissions: contents: read, so it is a safe addition.Here I did use claude code with my codespell'ing SKILL since otherwise it would be hard-to-impossible to weed out the typos. I did review the diff, it is quite big but really reviewable. It would be great if not postponed for long time since given the spread -- PR could rot quite quickly. I would be happy to address issues if any observed/reported to make UBERON typos freee
Details on the changes
Changes
Configuration & Infrastructure
.codespellrc— comprehensive config that:src/ontology/uberon-edit.obo(top-leveluberon.obo,uberon-base.owl,uberon-with-isa.obo,uberon-taxmod-*.obo,musculoskeletal.*,homology*,project.owl,reasoner_axioms.owl,rules.owl,ssso-merged-uberon.owl,depictions.owl,external-disjoints.owl).subsets/,src/ontology/imports/,src/ontology/taxmods/,src/ontology/diffs/,src/ontology/languages/(all derived), plussource-ontologies/,resources/,ext-mappings/,mappings/,modules/,reports/,attic/,bulk_ntr_workflow/,experimental/(external / auto-generated content), anddocs/resources/(binary graffle assets).src/scripts/ubermacros.el(~196k-line auto-generated Emacs macros indexing NCBITaxon species names — Latin binomials trip codespell).LICENSE(fixed legal wording).ignore-regexto protect URLs, camelCase/PascalCase identifiers, and cross-reference values after aPREFIX:(e.g.BAMS:MEnt) so external IDs are never "corrected".ignore-words-list(with per-word comments) for legitimate anatomical, Latin, medical, and abbreviation vocabulary that codespell flags as typos (e.g.mater,processus,vas,regio,collum,discus,cyclin,transferrin,formate,infarction,ans,als,sart,covert,panting,stye,preformed,pervious,horizontale,disjointness, etc.)..github/workflows/codespell.yml— GitHub Actions workflow using the officialcodespell-project/actions-codespellaction, pinned by SHA,permissions: contents: read, triggered on push and PR tomaster.Typo Fixes
Ambiguous typos fixed manually (each reviewed in context):
component fo the ODK→to,considere to be→considered to be(docs & references)wall fo trunk→wall of trunk,foor→foot(×2),fot phalanx→foot,eigth toe→eighth,partion→portion,throught→through(×3),retricts→restricts,identiy→identity,tha→that(×3),referes→refers,extermal→external,inernal→internal,bein→vein(obsoletion comment),con- sists→consists(line-break artifact) — all insrc/ontology/uberon-edit.obo.Formen→Foramenindef:line forectepicondylar foramen(codespell's single suggestion here wasForemen, which is wrong for the anatomy domain).Non-ambiguous typos auto-fixed with
codespell -wviadatalad runfor reproducible provenance. About 200 fixes acrosssrc/ontology/uberon-edit.obo, docs,reference/, and scripts. Common patterns:mucuous → mucous,analagous → analogous,accomodate → accommodate,opthalmic → ophthalmic,prinicipal → principal,Hoever → However,seperate → separate,thier → their,protruberances → protuberances, etc.False-positive reverts — reviewing the
codespell -wdiff surfaced 5 semantic false positives, all reverted in a follow-up commit and protected in the config so a future run cannot re-introduce them:crus horizontal striae diagonalis→crus horizontale(Latin adjective preserved).xref: BAMS:meant→xref: BAMS:MEnt(external cross-reference identifier).cemetery gland→cementary gland(documented RELATED synonym).duct remains previous→remains pervious(medical term: allowing passage).develop- meant→development(line-break artifact ofdevelopment).Historical Context
This repo has ~166 prior commits mentioning
typo,spelling, ormisspell— automated spell-checking will catch these before merge going forward.Testing
✅ Codespell passes with zero errors on this branch (with the configured skip / ignore rules).
Notes for reviewers
datalad runcommit records the exactuvx codespell -winvocation in git metadata for full provenance; the changes it introduced were then reviewed and 5 false positives were manually reverted in the next commit.src/ontology/uberon-edit.obowas reserialised withrobot convert -i src/ontology/uberon-edit.obo -f obo -o src/ontology/uberon-edit.obo(robot 1.9.10) as the final commit, per the project's editor SOP. The reserialisation only reorderedsynonym:lines alphabetically within their parent Term stanzas (16 lines moved across 9 hunks); no text content changed and codespell still passes with zero errors afterwards..codespellrcis heavily commented so future contributors can decide per-entry whether to keep or remove each skip / ignore entry as the corpus evolves.🤖 Generated with Claude Code (Opus 4.7, 1M context) in an interactive session with @yarikoptic.
PS I removed that
@ai4c-agentin signature since I did not use whatever that is . Let me know if I need to return it