Skip to content

Add codespell support with configuration and fixes#13

Open
yarikoptic wants to merge 4 commits into
ucscGenomeBrowser:developfrom
yarikoptic:enh-codespell
Open

Add codespell support with configuration and fixes#13
yarikoptic wants to merge 4 commits into
ucscGenomeBrowser:developfrom
yarikoptic:enh-codespell

Conversation

@yarikoptic

Copy link
Copy Markdown

Add codespell configuration and fix existing typos.

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").

The GitHub Actions CI workflow has permissions set only to read, so it is safe.

Changes

Configuration & Infrastructure

  • Added .codespellrc with skip patterns for vendored JavaScript libraries
    (*/ext/*, */node_modules/*), gene-annotation reference data
    (*/cellbrowserData/*, */cbWeb/genes/*), sample data (*/sampleData/*),
    generated artifacts (versioneer.py, */_version.py, */build/*,
    docs/_build/*, docs/build/*), the vendored EZID CLI from CDL
    (*/ucsc/ezid.py), local .git-meta/ worktrees, and binary/data
    filetypes (PDF/SVG/PNG/JPG/CSS/min.*, TSV/CSV/JSON/JSON.gz, fonts, h5ad,
    rds, .tags, .sizes).
  • Created .github/workflows/codespell.yml to check spelling on push and PRs
    to develop. Uses codespell-project/actions-codespell@v2 pinned by SHA.
    permissions: contents: read only.

Domain-Specific Whitelist

  • ore — JavaScript regex variable name (ore = /^0/) in the natural-sort
    code in cellBrowser.js. Documented inline in .codespellrc.

Typo Fixes

Ambiguous typos fixed manually (5 fixes with context review):

  • interativeinteractive (README.rst:43)
  • foof (docs/howto.rst:23 — "RDS file fo your dataset")
  • installioninstallation (docs/scanpy.rst:14)
  • recusivelyrecursively (cellbrowser.py:6798, in a commented-out block)
  • strinstring (cbData.js:236, in a comment)

False positives protected with inline codespell:ignore pragmas:

  • nd (the "not determined" abbreviation in two emptyVals /
    likeEmptyString lists) — cellbrowser.py:1143, cellBrowser.js:6380

Non-ambiguous typos fixed automatically via codespell -w (committed via
datalad run for reproducibility) — 50+ fixes across docs, Python, JS,
config files, and the ucsc/ scripts. Notable patterns:

  • coordiante(s) / coordinatscoordinate(s) (×6)
  • substractsubtract (×4)
  • indiciesindices (×4, including variable renames in
    ucsc/makeDatasetList)
  • relaserelease (×4)
  • configueconfigure (×2)
  • re-usereuse (×2)
  • Various one-offs: utilties, folllowing, colum, chnages, Couldnt,
    Jupyther, instread, likly, implicitely, gziped, expresssion,
    hideen, reponse, identifer(s), readble, endianess,
    compresssion, somtimes, overriden, specfied, necesssary,
    pre-selected, pallette, everthing, Attribue, antialising,
    Initialiaze, numer, acccession, adapated, annoucements,
    delimeter, alos, technicaly.

Historical Context

This project has had 41 prior commits mentioning typo / spelling /
spell fixes — many of them small, one-line follow-ups (git log --oneline --all --grep=typo --grep=spell --grep=spelling). Automating
this in CI catches them at PR time instead.

Testing

  • uvx codespell passes with zero errors after all fixes.
  • Python source files (cellbrowser.py, convert.py, genes.py,
    hubmaker.py) still parse with ast.parse.
  • JS files still parse with node -c.
  • Function names and JS XHR/DOM properties were not touched; only their
    surrounding comments and user-facing string literals.

🤖 Generated with Claude Code and love to typos free code

yarikoptic and others added 4 commits June 4, 2026 09:56
Co-Authored-By: Claude Code 2.1.162 / Claude Opus 4.7 <[email protected]>
Co-Authored-By: Claude Code 2.1.162 / Claude Opus 4.7 <[email protected]>
Manually fix typos requiring context review (single suggestion was
ambiguous to codespell):

- interative -> interactive (README.rst:43)
- fo -> of (docs/howto.rst:23)
- installion -> installation (docs/scanpy.rst:14)
- recusively -> recursively (cellbrowser.py:6798, in a comment)
- strin -> string (cbData.js:236, in a comment)

Protect false positives via inline `codespell:ignore` pragmas:

- "nd" string literal in emptyVals lists (cellbrowser.py:1143,
  cellBrowser.js:6380) — this is an empty-value abbreviation
  ("not determined"), not the start of "and" / "2nd".

Add JavaScript regex variable name `ore` (/^0/ in the natural-sort
code in cellBrowser.js) to ignore-words-list with an explanatory
comment.

Skip ucsc/ezid.py from codespell entirely — it is the vendored EZID
CLI client from CDL (California Digital Library) and contains
intentional CLI-usage notation like `c[reate][!]` that codespell
misreads as a "reate" typo.

Co-Authored-By: Claude Code 2.1.162 / Claude Opus 4.7 <[email protected]>
Fixed typos:
- re-use -> reuse (docs/bulk.rst, cellBrowser.js)
- utilties -> utilities (docs/combine.rst)
- folllowing -> following (docs/dataDesc.rst)
- configue -> configure (docs/howto.rst, 2x)
- coordinats -> coordinates (docs/howto.rst)
- relase -> release (docs/howto.rst x2, genes.py x2)
- colum -> column (cellbrowser.py)
- chnages -> changes (cellbrowser.py)
- Couldnt -> Couldn't (cellbrowser.py)
- Jupyther -> Jupyter (cellbrowser.py)
- instread -> instead (cellbrowser.py)
- likly -> likely (cellbrowser.py)
- implicitely -> implicitly (cellbrowser.py)
- gziped -> gzipped (convert.py)
- expresssion -> expression (hubmaker.py)
- hideen -> hidden (hubmaker.py)
- reponse -> response (cbData.js)
- identifers -> identifiers (cbData.js, hub.conf)
- substract -> subtract (cbData.js x4)
- readble -> readable (cbData.js)
- endianess -> endianness (cbData.js)
- compresssion -> compression (cbData.js)
- somtimes -> sometimes (cbData.js)
- overriden -> overridden (cellBrowser.js)
- specfied -> specified (cellBrowser.js)
- necesssary -> necessary (cellBrowser.js)
- pre-selected -> preselected (cellBrowser.js)
- pallette -> palette (cellBrowser.js)
- everthing -> everything (cellBrowser.js)
- Attribue -> Attribute (maxPlot.js)
- coordiante(s) -> coordinate(s) (maxPlot.js x5)
- antialising -> antialiasing (maxPlot.js)
- Initialiaze -> Initialize (maxPlot.js)
- numer -> number (cellbrowser.conf)
- acccession -> accession (desc.conf)
- identifer -> identifier (hub.conf)
- adapated -> adapted (ucsc/addTags x2)
- annoucements -> announcements (ucsc/generateAnnouncement)
- delimeter -> delimiter (ucsc/makeCbHub)
- indicies -> indices (ucsc/makeDatasetList x4)
- alos -> also (ucsc/tabulate_facets.pl)
- technicaly -> technically (ucsc/tabulate_facets.pl)

Co-Authored-By: Claude Code 2.1.162 / Claude Opus 4.7 <[email protected]>

=== Do not change lines below ===
{
 "chain": [],
 "cmd": "uvx codespell -w",
 "exit": 0,
 "extra_inputs": [],
 "inputs": [],
 "outputs": [],
 "pwd": "."
}
^^^ Do not change lines above ^^^

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a .codespellrc configuration file and fixes numerous spelling mistakes and typos across the codebase, including documentation, configuration files, and source code in JavaScript, Python, and Perl. The review feedback suggests updating deprecated logging.warn calls to logging.warning in cellbrowser.py to adhere to modern Python standards.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

##Check for cluster markers
if (markerField not in adata.uns or clusterField is not None) and not skipMarkers:
logging.warn("Couldnt find list of cluster marker genes in the h5ad file in adata.uns with the key '%s'. "
logging.warn("Couldn't find list of cluster marker genes in the h5ad file in adata.uns with the key '%s'. "

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The logging.warn method has been deprecated since Python 3.0 in favor of logging.warning. Since this line is already being modified, please update it to use logging.warning to adhere to modern Python standards and avoid future deprecation issues.

Suggested change
logging.warn("Couldn't find list of cluster marker genes in the h5ad file in adata.uns with the key '%s'. "
logging.warning("Couldn't find list of cluster marker genes in the h5ad file in adata.uns with the key '%s'. "


except ValueError:
logging.warn("Could not merge h5ad and meta data, skipping h5ad meta and using only provided meta. Most likly this happens when the field names in the h5ad and the meta file overlap")
logging.warn("Could not merge h5ad and meta data, skipping h5ad meta and using only provided meta. Most likely this happens when the field names in the h5ad and the meta file overlap")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The logging.warn method has been deprecated since Python 3.0 in favor of logging.warning. Since this line is already being modified, please update it to use logging.warning to adhere to modern Python standards and avoid future deprecation issues.

Suggested change
logging.warn("Could not merge h5ad and meta data, skipping h5ad meta and using only provided meta. Most likely this happens when the field names in the h5ad and the meta file overlap")
logging.warning("Could not merge h5ad and meta data, skipping h5ad meta and using only provided meta. Most likely this happens when the field names in the h5ad and the meta file overlap")

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