Add codespell support with configuration and fixes#822
Add codespell support with configuration and fixes#822yarikoptic wants to merge 7 commits intogoogle:mainfrom
Conversation
Signed-off-by: Yaroslav Halchenko <debian@onerussian.com>
Signed-off-by: Yaroslav Halchenko <debian@onerussian.com>
Signed-off-by: Yaroslav Halchenko <debian@onerussian.com>
Signed-off-by: Yaroslav Halchenko <debian@onerussian.com>
Fixed ambiguous typos: - custome -> custom (samples/client/angular/README.md:9) - 'Google Map custom components' - Reenable -> Re-enable (tools/editor/middleware/gemini.ts:23) - TODO comment Signed-off-by: Yaroslav Halchenko <debian@onerussian.com>
- Add ignore-regex for camelCase/PascalCase identifiers (e.g., doubleClick) - Remove codespell-problem-matcher step (built into actions-codespell@v2) Co-Authored-By: Claude Code 2.1.63 / Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Yaroslav Halchenko <debian@onerussian.com>
Fixed typos:
- releative -> relative (input-area.scss)
- reponse -> response (chat-service.ts)
- effecient -> efficient (a2ui_protocol.md)
Co-Authored-By: Claude Code 2.1.63 / Claude Opus 4.6 <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 ^^^
Signed-off-by: Yaroslav Halchenko <debian@onerussian.com>
0580d13 to
9659bc2
Compare
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
There was a problem hiding this comment.
Code Review
This pull request introduces codespell to automate typo detection, a valuable addition for maintaining code quality. The changes include the necessary configuration and fixes for several existing typos. My review focuses on enhancing the .codespellrc configuration to improve its effectiveness. I've suggested expanding the list of skipped directories to prevent noise from dependencies and build artifacts, and refining the regular expression for ignoring identifiers to better handle various coding styles like PascalCase with acronyms.
| @@ -0,0 +1,7 @@ | |||
| [codespell] | |||
| # Ref: https://github.com/codespell-project/codespell#using-a-config-file | |||
| skip = .git*,*.svg,package-lock.json,*-lock.yaml,*.lock,*.css,.codespellrc,.cache,.npm | |||
There was a problem hiding this comment.
It's a good practice to also exclude common build output and dependency directories from spell checking. Consider adding node_modules, build, and dist to the skip list to avoid spell-checking third-party code and generated files.
skip = .git*,*.svg,package-lock.json,*-lock.yaml,*.lock,*.css,.codespellrc,.cache,.npm,node_modules,build,dist
| skip = .git*,*.svg,package-lock.json,*-lock.yaml,*.lock,*.css,.codespellrc,.cache,.npm | ||
| check-hidden = true | ||
| # Ignore embedded base64 images in notebooks and camelCase/PascalCase identifiers | ||
| ignore-regex = ^\s*"image/\S+": ".*|\b[a-z]+[A-Z]\w*\b|\b[A-Z][a-z]+[A-Z]\w*\b |
There was a problem hiding this comment.
The current regex for ignoring PascalCase identifiers (\b[A-Z][a-z]+[A-Z]\w*\b) is a bit strict and might not cover cases with acronyms (e.g., URLHandler) or consecutive capital letters. A slightly broader but still safe regex could be \b[A-Z]\w*[A-Z]\w*\b, which ignores any word starting with a capital letter and containing at least one other capital letter. This would cover more identifier patterns while still avoiding common English words.
ignore-regex = ^\s*"image/\S+": ".*|\b[a-z]+[A-Z]\w*\b|\b[A-Z]\w*[A-Z]\w*\b
There was a problem hiding this comment.
not too bad AI! but I would say we can enter those waters when run into them
|
as for CLA check: ❌ e247fd1 Co-Author: <noy@anthropic.com>❌ e247fd1 Co-Author: <noy@anthropic.com> as I annotate claude code assisted commits with what would you expect me to do
|
Add codespell configuration and fix existing typos. This is a reincarnated
which was closed due to rot (conflicts) etc.
More about codespell: https://github.com/codespell-project/codespell
I personally introduced it to dozens if not hundreds of projects already and so far only positive feedback.
CI workflow has 'permissions' set only to 'read' so also should be safe.
Changes
Configuration & Infrastructure
.codespellrcwith skip patterns for SVG, lock files, CSS, cache dirsignore-regexfor camelCase/PascalCase identifiers (e.g.,doubleClick)ignore-words-listfor domain terms:ser(biology: serine),cyclin(biology: protein)Ambiguous Typos Fixed Manually (2 fixes)
custome->custom(samples/client/angular/README.md) - "Google Map custom components"Reenable->Re-enable(tools/editor/middleware/gemini.ts) - TODO commentNon-Ambiguous Typos Fixed with
codespell -w(3 fixes)releative->relative(input-area.scss)reponse->response(chat-service.ts)effecient->efficient(a2ui_protocol.md)All typo fixes are in comments/docs - no functional code changes.
Testing
Codespell passes with zero errors after all fixes.
🤖 Generated with Claude Code and love to typos free code