Skip to content

Fix spelling errors - #3452

Open
yarikoptic wants to merge 1 commit into
stan-dev:developfrom
yarikoptic:enh-codespell
Open

yarikoptic wants to merge 1 commit into
stan-dev:developfrom
yarikoptic:enh-codespell

Conversation

@yarikoptic

Copy link
Copy Markdown

Submission Checklist

  • Run unit tests: ./runTests.py src/test/unit — not run locally; the only code changes are comments and a same-length rename of a local test variable (sentinal → sentinel), so CI should cover it
  • Run cpplint: make cpplint — not run locally; no line lengths changed
  • Declare copyright holder and open-source license: see below

Summary

Add codespell config and a CI workflow, and fix the typos it currently finds.

I have added codespell to over a hundred projects already, mostly with positive feedback (see the "improveit-dashboard"). The workflow only has contents: read permission, so it should be safe. Git history has 200+ commits mentioning typo/spelling fixes, so automating this check seems worth it.

Details of changes

Configuration & CI

  • .codespellrc skips lib/ (vendored rapidjson, stan_math submodule), licenses/stan-doc-license.txt (verbatim CC license text), plus generic caches / minified assets.
  • ignore-words-list: alo (BFGS line search bracket variable, paired with ahi) and optin (clang-tidy check group in make/clang-tidy).
  • .github/workflows/codespell.yml runs on push to and PRs against develop.

Ambiguous typos fixed manually

  • enchanced → enhanced, tht → that (RELEASE-NOTES.txt)
  • doesnt' → doesn't (RELEASE-NOTES.txt)

Intentional spelling kept

  • src/test/unit/services/check_adaptation.hpp: "lements of inverse mass matrix:" is a deliberate substring match, so it is marked with // codespell:ignore-next-line.

Non-ambiguous typos fixed by codespell -w (recorded with datalad run)

  • sentinal → sentinel — local variables in src/test/unit/io/*, optimization and pathfinder tests
  • execption, implmentation — docstrings in src/stan/mcmc/chainset.hpp
  • lincense (README.md), and many typos in historical RELEASE-NOTES.txt

None of these fixes change behavior (no functional bug fixes found).

I also ran an extended pass (--builtin clear,rare,usage,code,names). It only reported domain terms (warmup, ith, stdio, master), so I left those as they are.

Intended Effect

Catch new typos in CI, and fix the existing ones.

How to Verify

pip install codespell && codespell (or uvx codespell) should exit 0. The Codespell CI job should pass.

Side Effects

None expected. Contributors may sometimes need to add a word to ignore-words-list in .codespellrc or use an inline codespell:ignore comment.

Documentation

None needed.

AI disclosure

Per the Stan AI Contribution Policy: I prepared this with help from Claude Code. I reviewed every change and can explain and defend it.

Copyright and Licensing

Please list the copyright holder for the work you are submitting (this will be you or your assignee, such as a university or company):

Yaroslav Halchenko

By submitting this pull request, the copyright holder is agreeing to license the submitted work under the following licenses:


🤖 Generated with Claude Code

@WardBrian

Copy link
Copy Markdown
Member

If we’d like to add this sort of checking I think it might make sense to move it inside our Jenkins pipeline rather than a separate action, though I’m also unsure if it’s worth gating PRs on

@yarikoptic

Copy link
Copy Markdown
Author

I don't have much (if any) experience with jenkins, but can easily strip github action off this PR, or ask claude to attempt to re-express it within present Jenkinsfile, just say.

@WardBrian WardBrian changed the title Add codespell support with configuration and fixes Fix spelling errors Oct 29, 2026
@WardBrian

Copy link
Copy Markdown
Member

Hi @yarikoptic, after some consideration I don't think spelling is something we'd like to gate CI on, but I'm planning on merging the spelling fixes you found as part of this effort. Thanks!

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.

2 participants