Repository navigation
Add codespell support with configuration and fixes - #3452
Open
yarikoptic wants to merge 6 commits into
Open
yarikoptic wants to merge 6 commits into
yarikoptic wants to merge 6 commits into
Conversation
… identifiers - skip lib/ (vendored rapidjson, stan_math submodule) and the verbatim CC license text, plus generic caches/.git-meta/minified assets - ignore "alo" (BFGS line search bracket variable) and "optin" (clang-tidy check group) Co-Authored-By: Claude Code 2.1.300 / Claude Opus 5.5 <noreply@anthropic.com>
- enchanced -> enhanced (RELEASE-NOTES.txt) - "enhanced include syntax" - tht -> that (RELEASE-NOTES.txt) - "in a way that is consistent" - check_adaptation.hpp: "lements of inverse mass matrix:" is a deliberate substring to match regardless of "E"/"e" casing; marked with codespell:ignore-next-line Co-Authored-By: Claude Code 2.1.300 / Claude Opus 5.5 <noreply@anthropic.com>
Fixed typos:
- sentinal -> sentinel (local variables in src/test/unit/io/*, optimization and pathfinder tests)
- execption -> exception, implmentation -> implementation (src/stan/mcmc/chainset.hpp docstrings)
- lincense -> license (README.md)
- various typos in historical RELEASE-NOTES.txt (adapatation, vas, maintanence,
seralization, doesnt', manaul, ouptut, user-defiend, Dcoumentation,
techinically, corect, supressed, constriants, initialze, priting)
Co-Authored-By: Claude Code 2.1.300 / Claude Opus 5.5 <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 ^^^
codespell -w does not rewrite this one due to the misplaced apostrophe. Co-Authored-By: Claude Code 2.1.300 / Claude Opus 5.5 <noreply@anthropic.com>
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 |
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. |
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.
Submission Checklist
./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 itmake cpplint— not run locally; no line lengths changedSummary
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: readpermission, 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
.codespellrcskipslib/(vendored rapidjson,stan_mathsubmodule),licenses/stan-doc-license.txt(verbatim CC license text), plus generic caches / minified assets.ignore-words-list:alo(BFGS line search bracket variable, paired withahi) andoptin(clang-tidy check group inmake/clang-tidy)..github/workflows/codespell.ymlruns on push to and PRs againstdevelop.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 withdatalad run)sentinal→sentinel— local variables insrc/test/unit/io/*, optimization and pathfinder testsexecption,implmentation— docstrings insrc/stan/mcmc/chainset.hpplincense(README.md), and many typos in historical RELEASE-NOTES.txtNone 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(oruvx 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-listin.codespellrcor use an inlinecodespell:ignorecomment.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