Add codespell support with configuration and fixes - #298
Open
yarikoptic wants to merge 6 commits into
Open
Conversation
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>
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, 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 itis 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 (
Inhforinhibitory neurons,
cyclin,selectin,transferrin,nestin,contactin,materas in "pia mater" / "dura mater", anatomicalabbreviations like
VILL,ONL, etc.).So
.codespellrcskips:bdso*.{owl,obo,json}— built release artifactssrc/ontology/{mirror,imports,components,tmp}— mirrored / imported /generated ontologies
src/{templates,markers,dendrograms,metadata}andsrc/test/test_data— data tablesimports/,scratch/,*.ipynb,*.tsv,*.csv,*.obo,*.owl,*.jsonsrc/test/marker_tools_test.py— referencesInh L1-2 VIP …clusternames verbatim
…and whitelists:
inh— "Inhibitory" neuron abbreviation (used pervasively acrosscell-type ontologies, e.g. "Inh L5-6 PVALB GAPDHP60")
ot— CLI flag--ot/args.ot("obsolete taxonomies") insrc/scripts/template_runner.pyThis leaves codespell focused on authored prose and source code, where it
caught a small but real set of typos.
Changes
Configuration & CI
.codespellrcwith the skip / whitelist described above.github/workflows/codespell.ymlrunning on push / PR againstmaster(uses pinned
codespell-project/actions-codespell@…v2.2, permissionsset to read-only)
.gitignorere-includes (!).codespellrcand.github/workflows/so they are visible despite the project's
**-gitignore-everythingpattern (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 …" —tht→that(codespell suggested
theorthat; context picksthat)Non-ambiguous (single suggestion, applied with
uvx codespell -w):README.md:tempaltes→templates(×3, including a URL path that nowcorrectly points at the actual
/src/templates/directory insteadof a non-existent
/src/tempaltes/)informtion→informationsrc/sparql/README.md:perfoming→performingsrc/scripts/update_repo.sh:wont→won'tsrc/ontology/Makefile:malicously→maliciously(×2),editted→edited— all in commentsFunctional / link fix worth noting
The
tempaltes→templatesfix onREADME.md:88repairs a brokenlink: the markdown link text was
[/src/tempaltes/]while the URLtargets
/src/templates/. After this change, the rendered link textmatches the real on-disk directory.
Testing
uvx codespellpasses with zero errors after these changes.🤖 Generated with Claude Code and love
to typos-free code