Skip to content

Add codespell support with configuration and fixes#1055

Open
yarikoptic wants to merge 5 commits intosourcebot-dev:mainfrom
yarikoptic:enh-codespell
Open

Add codespell support with configuration and fixes#1055
yarikoptic wants to merge 5 commits intosourcebot-dev:mainfrom
yarikoptic:enh-codespell

Conversation

@yarikoptic
Copy link
Copy Markdown

@yarikoptic yarikoptic commented Mar 28, 2026

Add codespell configuration and fix existing typos. AIs are good, but deterministic software sometimes still great to have to "complement" :-)

More about codespell: https://github.com/codespell-project/codespell

I personally introduced it to over a hundred of projects already mostly with a positive feedback
(see the "improveit-dashboard").

CI workflow has 'permissions' set only to 'read' so also should be safe.

Changes

Configuration & Infrastructure

  • Added .codespellrc configuration with skip patterns for .yarn/, _typos.toml, vendor/, *.lock, *.css, *.svg
  • Created GitHub Actions workflow to check spelling on push to main and PRs
  • Added camelCase/PascalCase regex to avoid false positives on code identifiers (notIn, fileTests, etc.)

Domain-Specific Whitelist

Added legitimate terms that codespell flags as typos:

  • pris - prisma datasource name
  • wast - WebAssembly Text format (language name)
  • ags, abl - abbreviations in language metadata
  • rouge - syntax highlighter name (not "rogue")
  • edn - EDN file format (Clojure data notation)
  • requestor - valid term used consistently as a prop name

Typo Fixes

Ambiguous typos fixed manually (8 fixes with context review):

  • Lastest -> Latest (reposTable.tsx, connectionsTable.tsx) - UI header text
  • tood -> todo (searchModeSelector.tsx) - @todo comment tag
  • inbetween -> in between (searchSuggestionsBox.test.tsx) - test description
  • throught -> through (sso.ts) - "through the identityProvider"
  • peform -> perform, loosing -> losing (chatThread.tsx) - comments
  • incase -> in case (utils.ts) - comment text

Non-ambiguous typos fixed with codespell -w (22 fixes in 12 files):
Common fixes include: seperated/seperate -> separated/separate, embeded -> embedded,
overriden -> overridden, parantheses -> parentheses, deprected -> deprecated,
striclty -> strictly, visibile -> visible, exaustive -> exhaustive,
aggregrating -> aggregating, matchs -> matches, outputing -> outputting,
Chnage -> Change, requets -> requests, langauge -> language

Historical Context

This project has had 30 prior commits fixing typos manually, demonstrating the value of automated spell-checking.

Testing

Codespell passes with zero errors after all fixes.


🤖 Generated with Claude Code and love to typos free code

Summary by CodeRabbit

  • Chores

    • Added Codespell configuration and GitHub Actions workflow to automatically detect and prevent spelling errors in the codebase.
  • Documentation

    • Fixed multiple spelling and grammar corrections across documentation, changelog entries, and system messages for improved clarity and consistency.

yarikoptic and others added 5 commits March 28, 2026 09:05
Skip .yarn/ (bundled binary), _typos.toml (typos config).
Add camelCase/PascalCase regex to ignore code identifiers.
Add domain-specific terms: pris, wast, ags, abl, rouge, edn, requestor.

Co-Authored-By: Claude Code 2.1.63 / Claude Opus 4.6 <noreply@anthropic.com>
Fixed ambiguous typos:
- Lastest -> Latest (reposTable.tsx, connectionsTable.tsx) - header text
- tood -> todo (searchModeSelector.tsx) - @todo comment tag
- inbetween -> in between (searchSuggestionsBox.test.tsx) - test description
- throught -> through (sso.ts) - "through the identityProvider"
- peform -> perform, loosing -> losing (chatThread.tsx) - comments
- incase -> in case (utils.ts) - comment text

Co-Authored-By: Claude Code 2.1.63 / Claude Opus 4.6 <noreply@anthropic.com>
Fixed typos:
- seperated -> separated (CHANGELOG.md, syntaxReferenceGuide.tsx)
- requets -> requests (CHANGELOG.md)
- seperate -> separate (CHANGELOG.md x3, repoCompileUtils.ts, atMentionButton.tsx)
- langauge -> language (CHANGELOG.md)
- Chnage -> Change (CHANGELOG.md)
- overriden -> overridden (entrypoint.sh)
- embeded -> embedded (entrypoint.sh x2)
- outputing -> outputting (language-model-providers.mdx)
- deprected -> deprecated (constants.ts)
- striclty -> strictly (prisma.ts)
- parantheses -> parentheses, Parantheses -> Parentheses (syntaxReferenceGuide.tsx)
- visibile -> visible (chatThreadListItem.tsx)
- exaustive -> exhaustive (zoektSearcher.ts)
- aggregrating -> aggregating (RepoStats.ts x2)
- matchs -> matches (SearchOptions.ts x2)

Co-Authored-By: Claude Code 2.1.63 / Claude Opus 4.6 <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 28, 2026

Walkthrough

This PR adds a spell-checking configuration and corrects spelling and grammar errors across the codebase including documentation, comments, and UI text. No logic or functional behavior is modified.

Changes

Cohort / File(s) Summary
Spell-checking Configuration
.codespellrc, .github/workflows/codespell.yml
Added Codespell configuration file with skip patterns for non-source directories and generated artifacts, and created a GitHub Actions workflow to run spell checks on push and pull requests targeting main.
Documentation & Configuration
CHANGELOG.md, docs/docs/configuration/language-model-providers.mdx, entrypoint.sh
Fixed spelling errors (e.g., "seperated" → "separated", "requets" → "requests", "embeded" → "embedded") and corrected "Breaking Chnage" → "Breaking Change" in changelog; re-applied verbatim documentation text; and corrected comments in shell script.
Backend & Shared Package
packages/backend/src/repoCompileUtils.ts, packages/shared/src/constants.ts
Fixed inline comments: "seperate" → "separate" in Gerrit config and "deprected" → "deprecated" in constants.
Frontend Components
packages/web/src/app/[domain]/browse/hooks/utils.ts, packages/web/src/app/[domain]/components/searchBar/searchSuggestionsBox.test.tsx, packages/web/src/app/[domain]/components/searchModeSelector.tsx, packages/web/src/app/[domain]/components/syntaxReferenceGuide.tsx, packages/web/src/app/[domain]/repos/components/reposTable.tsx, packages/web/src/app/[domain]/settings/connections/components/connectionsTable.tsx, packages/web/src/ee/features/sso/sso.ts, packages/web/src/features/chat/components/chatBox/atMentionButton.tsx, packages/web/src/features/chat/components/chatThread/chatThread.tsx, packages/web/src/features/chat/components/chatThread/chatThreadListItem.tsx, packages/web/src/features/search/zoektSearcher.ts, packages/web/src/prisma.ts
Fixed multiple comment and UI text typos: "incase" → "in case", "inbetween" → "in between", "@TOOD" → "@todo", "space-seperated" → "space-separated", "parantheses" → "Parentheses", "Lastest" → "Latest", "throught" → "through", "peform" → "perform", "loosing" → "losing", "visibile" → "visible", "exaustive" → "exhaustive", "striclty" → "strictly".
Generated Proto Files
packages/web/src/proto/zoekt/webserver/v1/RepoStats.ts, packages/web/src/proto/zoekt/webserver/v1/SearchOptions.ts
Updated JSDoc comments: "aggregrating" → "aggregating" and "matchs" → "matches" in field documentation.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

Suggested reviewers

  • msukkari
  • brendan-kellam
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: adding codespell tooling integration and applying spelling corrections across the repository.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
CHANGELOG.md (1)

8-8: ⚠️ Potential issue | 🟡 Minor

Missing CHANGELOG entry for this PR.

The [Unreleased] section is empty. According to the coding guidelines, every PR must include a CHANGELOG entry except for documentation-only changes. This PR adds codespell configuration and CI workflow (infrastructure changes), so it should have an entry.

As per coding guidelines: Every PR must include a follow-up commit adding an entry to CHANGELOG.md under [Unreleased]. The entry must be a single sentence describing the change, followed by a link to the PR in the format #. Place new entries at the bottom of the appropriate section (Added, Changed, Fixed, etc.).

📝 Suggested CHANGELOG entry
 ## [Unreleased]
+
+### Added
+- Added codespell configuration and GitHub Actions workflow for automated spell checking. [`#1055`](https://github.com/sourcebot-dev/sourcebot/pull/1055)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@CHANGELOG.md` at line 8, Add a one-sentence CHANGELOG entry under the
[Unreleased] section describing the addition of codespell configuration and the
CI workflow, placing it at the bottom of the appropriate subsection (e.g.,
"Changed"); format the sentence and include the PR link using the exact link
style [#<id>](https://github.com/sourcebot-dev/sourcebot/pull/<id>) so the entry
looks like: <single sentence>
[#<id>](https://github.com/sourcebot-dev/sourcebot/pull/<id>).
🧹 Nitpick comments (1)
CHANGELOG.md (1)

558-558: Consider hyphenating compound modifier (optional).

The static analysis tool suggests "comma-separated" with a hyphen when used as a compound adjective modifying "list". While "comma separated" is commonly accepted, the hyphenated form follows stricter style guides. This is a very minor style point and not critical.

📝 Optional style improvement
-- Added `ALWAYS_INDEX_FILE_PATTERNS` environment variable to allow specifying a comma separated list of glob patterns matching file paths that should always be indexed, regardless of size or # of trigrams. [`#631`](https://github.com/sourcebot-dev/sourcebot/pull/631)
+- Added `ALWAYS_INDEX_FILE_PATTERNS` environment variable to allow specifying a comma-separated list of glob patterns matching file paths that should always be indexed, regardless of size or # of trigrams. [`#631`](https://github.com/sourcebot-dev/sourcebot/pull/631)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@CHANGELOG.md` at line 558, Update the changelog entry for the
ALWAYS_INDEX_FILE_PATTERNS environment variable to use the hyphenated compound
modifier "comma-separated" (e.g., change "comma separated list" to
"comma-separated list") so the phrase reads "a comma-separated list of glob
patterns" while keeping the rest of the sentence intact; locate the sentence
mentioning ALWAYS_INDEX_FILE_PATTERNS and adjust only that compound adjective.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@packages/web/src/app/`[domain]/browse/hooks/utils.ts:
- Line 39: Update the inline comment that currently refers to
"decodedURIComponent" to the correct JavaScript function name
"decodeURIComponent" so the comment matches the actual usage of
decodeURIComponent in this file (references around the decodeURIComponent calls
in utils.ts).

In `@packages/web/src/app/`[domain]/components/syntaxReferenceGuide.tsx:
- Line 253: Replace the awkward user-facing phrase "and'd" in the
SyntaxReferenceGuide component text with clearer wording such as "ANDed" or
"combined with AND"; locate the string inside the syntaxReferenceGuide.tsx JSX
(the paragraph containing CodeSnippet usage for "or", "()", and "-" negation)
and update the sentence to read e.g. "By default, space-separated expressions
are ANDed together" or "By default, space-separated expressions are combined
with AND" so the documentation is clearer to users.

---

Outside diff comments:
In `@CHANGELOG.md`:
- Line 8: Add a one-sentence CHANGELOG entry under the [Unreleased] section
describing the addition of codespell configuration and the CI workflow, placing
it at the bottom of the appropriate subsection (e.g., "Changed"); format the
sentence and include the PR link using the exact link style
[#<id>](https://github.com/sourcebot-dev/sourcebot/pull/<id>) so the entry looks
like: <single sentence>
[#<id>](https://github.com/sourcebot-dev/sourcebot/pull/<id>).

---

Nitpick comments:
In `@CHANGELOG.md`:
- Line 558: Update the changelog entry for the ALWAYS_INDEX_FILE_PATTERNS
environment variable to use the hyphenated compound modifier "comma-separated"
(e.g., change "comma separated list" to "comma-separated list") so the phrase
reads "a comma-separated list of glob patterns" while keeping the rest of the
sentence intact; locate the sentence mentioning ALWAYS_INDEX_FILE_PATTERNS and
adjust only that compound adjective.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 1c560eda-3e84-425c-8755-f405b891a426

📥 Commits

Reviewing files that changed from the base of the PR and between 2fa86ff and 0c4ff92.

📒 Files selected for processing (21)
  • .codespellrc
  • .github/workflows/codespell.yml
  • CHANGELOG.md
  • docs/docs/configuration/language-model-providers.mdx
  • entrypoint.sh
  • packages/backend/src/repoCompileUtils.ts
  • packages/shared/src/constants.ts
  • packages/web/src/app/[domain]/browse/hooks/utils.ts
  • packages/web/src/app/[domain]/components/searchBar/searchSuggestionsBox.test.tsx
  • packages/web/src/app/[domain]/components/searchModeSelector.tsx
  • packages/web/src/app/[domain]/components/syntaxReferenceGuide.tsx
  • packages/web/src/app/[domain]/repos/components/reposTable.tsx
  • packages/web/src/app/[domain]/settings/connections/components/connectionsTable.tsx
  • packages/web/src/ee/features/sso/sso.ts
  • packages/web/src/features/chat/components/chatBox/atMentionButton.tsx
  • packages/web/src/features/chat/components/chatThread/chatThread.tsx
  • packages/web/src/features/chat/components/chatThread/chatThreadListItem.tsx
  • packages/web/src/features/search/zoektSearcher.ts
  • packages/web/src/prisma.ts
  • packages/web/src/proto/zoekt/webserver/v1/RepoStats.ts
  • packages/web/src/proto/zoekt/webserver/v1/SearchOptions.ts

const pathType = path.startsWith('tree') ? 'tree' : 'blob';

// @note: decodedURIComponent is needed here incase the path contains a space.
// @note: decodedURIComponent is needed here in case the path contains a space.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Fix typo in function name within the comment.

The comment references "decodedURIComponent" but the actual function name is "decodeURIComponent" (without the extra "d" at the end of "decode"), as seen on lines 43 and 48.

📝 Proposed fix
-        // `@note`: decodedURIComponent is needed here in case the path contains a space.
+        // `@note`: decodeURIComponent is needed here in case the path contains a space.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
// @note: decodedURIComponent is needed here in case the path contains a space.
// `@note`: decodeURIComponent is needed here in case the path contains a space.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/web/src/app/`[domain]/browse/hooks/utils.ts at line 39, Update the
inline comment that currently refers to "decodedURIComponent" to the correct
JavaScript function name "decodeURIComponent" so the comment matches the actual
usage of decodeURIComponent in this file (references around the
decodeURIComponent calls in utils.ts).

<h3 className="text-lg font-semibold mt-4 mb-0">Boolean operators &amp; grouping</h3>
<p className="text-sm mb-2 mt-0">
By default, space-seperated expressions are and&apos;d together. Using the <CodeSnippet>or</CodeSnippet> keyword as well as parantheses <CodeSnippet>()</CodeSnippet> can be used to create more complex boolean logic. Parantheses can be negated using the <CodeSnippet>-</CodeSnippet> prefix.
By default, space-separated expressions are and&apos;d together. Using the <CodeSnippet>or</CodeSnippet> keyword as well as parentheses <CodeSnippet>()</CodeSnippet> can be used to create more complex boolean logic. Parentheses can be negated using the <CodeSnippet>-</CodeSnippet> prefix.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Improve wording clarity in user-facing docs text.

Line 253 uses “and’d,” which reads awkwardly. Consider “ANDed” (or “combined with AND”) for clearer guidance.

✏️ Suggested text refinement
-                        By default, space-separated expressions are and&apos;d together. Using the <CodeSnippet>or</CodeSnippet> keyword as well as parentheses <CodeSnippet>()</CodeSnippet> can be used to create more complex boolean logic. Parentheses can be negated using the <CodeSnippet>-</CodeSnippet> prefix.
+                        By default, space-separated expressions are ANDed together. The <CodeSnippet>or</CodeSnippet> keyword and parentheses <CodeSnippet>()</CodeSnippet> can be used to create more complex boolean logic. Parentheses can be negated using the <CodeSnippet>-</CodeSnippet> prefix.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
By default, space-separated expressions are and&apos;d together. Using the <CodeSnippet>or</CodeSnippet> keyword as well as parentheses <CodeSnippet>()</CodeSnippet> can be used to create more complex boolean logic. Parentheses can be negated using the <CodeSnippet>-</CodeSnippet> prefix.
By default, space-separated expressions are ANDed together. The <CodeSnippet>or</CodeSnippet> keyword and parentheses <CodeSnippet>()</CodeSnippet> can be used to create more complex boolean logic. Parentheses can be negated using the <CodeSnippet>-</CodeSnippet> prefix.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/web/src/app/`[domain]/components/syntaxReferenceGuide.tsx at line
253, Replace the awkward user-facing phrase "and'd" in the SyntaxReferenceGuide
component text with clearer wording such as "ANDed" or "combined with AND";
locate the string inside the syntaxReferenceGuide.tsx JSX (the paragraph
containing CodeSnippet usage for "or", "()", and "-" negation) and update the
sentence to read e.g. "By default, space-separated expressions are ANDed
together" or "By default, space-separated expressions are combined with AND" so
the documentation is clearer to users.

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.

1 participant