Skip to content

Add codespell support with configuration and fixes#822

Open
yarikoptic wants to merge 7 commits intogoogle:mainfrom
yarikoptic:enh-codespell
Open

Add codespell support with configuration and fixes#822
yarikoptic wants to merge 7 commits intogoogle:mainfrom
yarikoptic:enh-codespell

Conversation

@yarikoptic
Copy link

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

  • Added .codespellrc with skip patterns for SVG, lock files, CSS, cache dirs
  • Created GitHub Actions workflow to check spelling on push to main and PRs
  • Added ignore-regex for camelCase/PascalCase identifiers (e.g., doubleClick)
  • Added ignore-words-list for 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 comment

Non-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

yarikoptic and others added 7 commits March 11, 2026 20:26
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>
@google-cla
Copy link

google-cla bot commented Mar 12, 2026

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.

Copy link
Contributor

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

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 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
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

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
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

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

Copy link
Author

Choose a reason for hiding this comment

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

not too bad AI! but I would say we can enter those waters when run into them

@yarikoptic
Copy link
Author

as for CLA check:

e247fd1 Co-Author: <noy​@anthropic.com>❌ e247fd1 Co-Author: <noy​@anthropic.com>

as I annotate claude code assisted commits with

Co-Authored-By: Claude Code 2.1.63 / Claude Opus 4.6 <noreply@anthropic.com>

what would you expect me to do

  • drop that annotation?
  • CLA on that beast's behalf?
  • nevermind

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

1 participant