Skip to content

ci/spelling: Add spelling PR check - #1853

Open
marcleblanc2 wants to merge 10 commits into
mainfrom
add-cspell-pr-check
Open

ci/spelling: Add spelling PR check#1853
marcleblanc2 wants to merge 10 commits into
mainfrom
add-cspell-pr-check

Conversation

@marcleblanc2

@marcleblanc2 marcleblanc2 commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Linear FE-499: Fix doc site issues

Summary

  • Install CSpell 10 in CI only (not a project dependency); npx cspell@10 --no-progress --dot '**/*' runs the full-repository check locally
  • Add a custom dictionary file to allowlist needed words
  • On pull requests, report only spelling errors on lines added by the PR, so existing repository findings are ignored
  • Create / update one PR summary comment containing grouped file, line, column, word, and context details, plus an inline review comment per flagged line with a one-click GitHub suggestion for the best candidate
  • Every comment links to cspell-allow-list.txt on the PR branch, to allowlist false positives
  • Resolve the comment after fixes
  • Initially roll out the PR check as non-blocking, while preserving the local command's failing exit code

Verification

  • Simulated an added typo: the diff checker exited 1 and reported exactly that word, line, column, and context
  • Reverted the typo: the diff checker exited 0 despite pre-existing repository findings
  • Prettier checks passed for the script, package/config, and workflow
  • Workflow YAML parsed successfully and every shell run block passed bash -n
  • node --check dev/check-spelling.mjs
  • git diff --check

Exclusions

  • CSpell honors .gitignore, so dependency, cache, and build output remain excluded
  • The full local check additionally skips:
    • Binary image/font formats
    • pnpm-lock.yaml
    • CSpell's own config/dictionary
    • Checked-in generated outputs (docs/technical-changelog.mdx, generated observability alert/dashboard references, and the generated AWS icon module)

Screenshots

From demo PRs #1892 and #1893:

Summary comment

CSpell summary comment

Inline review comment

CSpell inline review comment

Amp threads

@vercel

vercel Bot commented Sep 4, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
sourcegraph-docs Ready Ready Preview Sep 9, 2026 10:27am UTC

Request Review

marcleblanc2 and others added 5 commits September 8, 2026 18:35
Remove the 126 misspelled words from cspell-project-words.txt: the 112
words already listed in flagWords, plus 14 more found while reviewing the
dictionary (addresseses, Changs, certains, condeintel, ERRROS, gorelaser,
lobal, Redict, settingscasacde, sguqery, Sourcegraphs, Stablechore,
theyre, Wofli). The words that still appear in non-generated docs are
fixed in #1855 and #1873; the rest only occur in generated files that
cspell.json already ignores.

Keep eror, functio, and stabili in the dictionary and stop flagging them:
eror is Sourcegraph's log level token (lvl=eror), and functio and stabili
are truncation artifacts in verbatim command output, not misspellings.

Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-01a07e67-73b3-779f-8880-7ba770fe7ade
check-spelling.mjs gains --format json (with cspell suggestions) and loses
the markdown formatter. post-spelling-review.mjs owns all GitHub posting:
the existing summary comment, plus one COMMENT review per run with an
inline comment on each newly flagged line. Comments for findings that are
still present are kept; stale ones are deleted. Capped at 25 inline per run.

Amp-Thread-ID: https://ampcode.com/threads/T-01a0837b-04dc-7559-831d-ba3b35c75489
Co-authored-by: Amp <amp@ampcode.com>
check-spelling.mjs emits the full source line. Each inline comment carries a
suggestion block per cspell candidate (up to 3), with candidates matching the
flagged word's initial capitalization listed first.

Amp-Thread-ID: https://ampcode.com/threads/T-01a0837b-04dc-7559-831d-ba3b35c75489
Co-authored-by: Amp <amp@ampcode.com>
@marcleblanc2 marcleblanc2 changed the title ci: Add spelling PR check ci/spelling: Add spelling PR check Sep 9, 2026
Keep this PR to the CSpell check and dictionary. The LINTER_ERRROS,
gorelaserConfig, sguqery, lobal, and imedout fixes now live in #1873.
marcleblanc2 added a commit that referenced this pull request Sep 9, 2026
Moved from #1853 so that PR stays scoped to the CSpell check.
…elog TODO

The docs/ example placeholder swaps now live in #1873 so this PR is
only the CSpell check and dictionary. cspell.json gains a TODO to drop
the technical-changelog ignore once PR 1888 merges.
marcleblanc2 added a commit that referenced this pull request Sep 9, 2026
Fake commit hash, tmp filename, pod name, TLS cert blobs, ARN, and
base64 IDs in examples, replaced with placeholders that look realistic
and pass the spell check. Moved from #1853.
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