Skip to content

Add codespell support with configuration and fixes - #298

Open
yarikoptic wants to merge 6 commits into
obophenotype:masterfrom
yarikoptic:enh-codespell
Open

Add codespell support with configuration and fixes#298
yarikoptic wants to merge 6 commits into
obophenotype:masterfrom
yarikoptic:enh-codespell

Conversation

@yarikoptic

Copy link
Copy Markdown

Add codespell configuration, CI workflow, and fix a handful of typos in
authored prose/code.

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
"improveit-dashboard"
for a write-up). The CI workflow has permissions: contents: read, so it
is safe.

Why scope matters here

This is an ontology project, so most files are either built artifacts or
contain biological/anatomical/genetic terminology inherited from upstream
sources — they are not prose authored in this repo and should not be
"corrected". codespell flagged ~75k matches when run without any skips,
the overwhelming majority of which are legitimate domain terms (Inh for
inhibitory neurons, cyclin, selectin, transferrin, nestin,
contactin, mater as in "pia mater" / "dura mater", anatomical
abbreviations like VILL, ONL, etc.).

So .codespellrc skips:

  • bdso*.{owl,obo,json} — built release artifacts
  • src/ontology/{mirror,imports,components,tmp} — mirrored / imported /
    generated ontologies
  • src/{templates,markers,dendrograms,metadata} and
    src/test/test_data — data tables
  • imports/, scratch/, *.ipynb, *.tsv, *.csv, *.obo, *.owl,
    *.json
  • src/test/marker_tools_test.py — references Inh L1-2 VIP … cluster
    names verbatim

…and whitelists:

  • inh — "Inhibitory" neuron abbreviation (used pervasively across
    cell-type ontologies, e.g. "Inh L5-6 PVALB GAPDHP60")
  • ot — CLI flag --ot / args.ot ("obsolete taxonomies") in
    src/scripts/template_runner.py

This leaves codespell focused on authored prose and source code, where it
caught a small but real set of typos.

Changes

Configuration & CI

  • .codespellrc with the skip / whitelist described above
  • .github/workflows/codespell.yml running on push / PR against master
    (uses pinned codespell-project/actions-codespell@…v2.2, permissions
    set to read-only)
  • .gitignore re-includes (!) .codespellrc and .github/workflows/
    so they are visible despite the project's **-gitignore-everything
    pattern (carried over from the existing setup commits on this branch)

Typo fixes

Ambiguous (manual, with context review):

  • README.md:17 "groupings tht do not correspond …" — thtthat
    (codespell suggested the or that; context picks that)

Non-ambiguous (single suggestion, applied with uvx codespell -w):

  • README.md:
    • tempaltestemplates (×3, including a URL path that now
      correctly points at the actual /src/templates/ directory instead
      of a non-existent /src/tempaltes/)
    • informtioninformation
  • src/sparql/README.md: perfomingperforming
  • src/scripts/update_repo.sh: wontwon't
  • src/ontology/Makefile: malicouslymaliciously (×2),
    edittededited — all in comments

Functional / link fix worth noting

The tempaltestemplates fix on README.md:88 repairs a broken
link: the markdown link text was [/src/tempaltes/] while the URL
targets /src/templates/. After this change, the rendered link text
matches the real on-disk directory.

Testing

uvx codespell passes with zero errors after these changes.


🤖 Generated with Claude Code and love
to typos-free code

yarikoptic and others added 6 commits June 1, 2026 08:19
Otherwise git would keep ignoring them!

    ❯ git add .github/workflows/code*
    The following paths are ignored by one of your .gitignore files:
    .github/workflows/codespell.yml
    hint: Use -f if you really want to add them.
    hint: Disable this message with "git config set advice.addIgnoredFile false"
Configure codespell to skip generated/imported ontology artifacts and data
tables (bdso*.{owl,obo,json}, src/ontology/{mirror,imports,components,tmp},
src/{templates,markers,dendrograms,metadata}, src/test/test_data, scratch,
*.ipynb, *.tsv, *.csv) so it operates only on authored prose and code.
Whitelist 'inh' (Inhibitory neuron) and 'ot' (CLI flag).

Update the workflow to trigger on master push/PR (was bf-gitignore, a
development branch used during initial setup).

Co-Authored-By: Claude Code 2.1.159 / Claude Opus 4.7 (1M context) <noreply@anthropic.com>
codespell flagged 'tht' with two suggestions (the/that); from context
("groupings tht do not correspond ..."), the intended word is 'that'.

Co-Authored-By: Claude Code 2.1.159 / Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Fixed typos in authored prose/code (datalad run could not auto-commit due
to this repo's gitignore-everything pattern, so applied changes are
committed manually):

- README.md: 'tempaltes' -> 'templates' (x3), 'informtion' -> 'information'
  (one occurrence was in a /src/tempaltes/ URL — now correctly points at
  the actual /src/templates/ directory)
- src/sparql/README.md: 'perfoming' -> 'performing'
- src/scripts/update_repo.sh: 'wont' -> "won't"
- src/ontology/Makefile: 'malicously' -> 'maliciously' (x2),
  'editted' -> 'edited'

Run command: uvx codespell -w

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