Add codespell config, CI, and typo fixes - #8
Open
yarikoptic wants to merge 8 commits into
Open
Conversation
- Skip binary keras metadata files (*.pb) and the optimized_models directory to avoid encoding warnings on serialized model weights. - Whitelist Spanish word "momento" (used in a Spanish-language code comment in rippl_AI.py) and "commun" (abbreviation of "Communications" in the Nature Commun Biol journal reference). Co-Authored-By: Claude Code 2.1.138 / Claude Opus 4.7 <noreply@anthropic.com>
- README.md:276 "explotation" -> "exploitation" (leveraging the toolbox to construct an exploration module; not the "exploration" suggestion, which would collide with the module name). - aux_fcn.py:555 "precission" -> "precision" (ML performance metric, not "percussion"/"precession"). - examples_explore/example_XGBOOST.ipynb "update te predictor" -> "update the predictor" (article, not any of "be"/"we"/"to"). Co-Authored-By: Claude Code 2.1.138 / Claude Opus 4.7 <noreply@anthropic.com>
The .git-meta directory is a per-user convention for storing local commit-message and PR-body drafts outside of source control. Skipping it prevents codespell from flagging the *description* of typos we're about to fix as typos themselves. Co-Authored-By: Claude Code 2.1.138 / Claude Opus 4.7 <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 rewrote `Cant` -> `Can't` at aux_fcn.py:677,682, but both occurrences live inside single-quoted Python string literals, so the resulting apostrophe closed the string prematurely and produced a SyntaxError (unterminated string literal). Switch the outer quotes to double so the contraction is valid. Co-Authored-By: Claude Code 2.1.138 / Claude Opus 4.7 <noreply@anthropic.com>
Not caught by the default codespell dictionaries (clear+rare); found via a `codespell --builtin clear,rare,usage,code,names` follow-up review pass. Remaining hits from that pass (arange, amin, hist) are NumPy / matplotlib function names and were intentionally left as-is. Co-Authored-By: Claude Code 2.1.138 / Claude Opus 4.7 <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, a GitHub Actions workflow that runs it on push and PRs, and fix all existing typos it flags.
More about codespell: https://github.com/codespell-project/codespell
I've introduced codespell to a hundred-plus projects with mostly positive feedback (see the
improveit-dashboardoverview). The CI job runs withpermissions: contents: readonly, so it's safe.Changes
Configuration & CI
.codespellrcwith skip patterns and a domain whitelist..github/workflows/codespell.ymlrunning onpush/pull_requesttomain, using the pinnedcodespell-project/actions-codespell@v2.2action.Skip patterns
*.pb,optimized_models/— serialized Keras/TF model weights that codespell fails to decode..git,.git-meta,.gitignore,.gitattributes,.codespellrc— infrastructure.Whitelisted words (
ignore-words-list)momento— Spanish word ("moment") in a Spanish-language comment inrippl_AI.py; codespell would otherwise "correct" it tomemento.commun— abbreviation of Communications in the Nature Commun Biol journal reference in the README.Typo fixes
3 ambiguous typos fixed manually (context-dependent choice)
README.md:276explotationexploitationaux_fcn.py:555precissionprecisionpercussion/precessionexamples_explore/example_XGBOOST.ipynbupdate te predictorupdate the predictorbe/we/to~70 non-ambiguous typos fixed via
codespell -wFixed via
datalad run 'codespell -w'(a reproducible commit — the exact command is recorded in the commit metadata). Representative fixes:Artifical→Artificialrespository→repositorysenstive→sensitive,postive→positivemiliseconds→milliseconds(×7)begining→beginning(×7)enviroment→environment(×5)arquitecture→architecture,oficial→official,sesion→session(Spanish-speaker English typos across notebooks)proccessed→processed,simutaneously→simultaneously,lamda→lambdahapenning→happening,supossedly→supposedlywont→won't,Cant→Can't,viceversa→vice-versaFollow-up fixes to codespell's own output
aux_fcn.py:677,682—codespell -wrewroteCant→Can'tinside single-quoted string literals, which broke Python syntax (SyntaxError: unterminated string literal). Switched the outer quotes to double so the contraction parses. This is a real bug in the tree that was masked by the fact that these branches are error paths.aux_fcn.py:1211—dont→don'tin a comment; not caught by the default codespell dictionaries (clear+rare), surfaced by a follow-up--builtin clear,rare,usage,code,namesreview pass and fixed by hand.Historical context
git log --all --grep=typofinds 8 prior typo-fix commits, so typo drift is a recurring maintenance burden here — automated checking should reduce that friction going forward.Testing
codespellpasses with zero errors on the branch tip.python3 -c "import ast; ast.parse(...)"onaux_fcn.pyandrippl_AI.py— both parse (verifies theCan't-in-single-quotes SyntaxError fromcodespell -wwas caught and fixed).Generated with Claude Code and love to typos free code