Repository navigation
Add the /spell command to allow words from a PR comment - #2113
Open
marcleblanc2 wants to merge 3 commits into
Open
marcleblanc2 wants to merge 3 commits into
marcleblanc2 wants to merge 3 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
Contributor
This comment has been minimized.
This comment has been minimized.
A comment of /spell <words> (or /spell allow <words>) on a PR adds the words CSpell does not accept yet to cspell-allow-list.txt on the PR's branch, reacts with a thumbs up, and approves the checks that the push creates in an approval-required state, since GITHUB_TOKEN made it. The spell check's comments tell the author about the command. Co-authored-by: Amp <amp@ampcode.com> Amp-Thread-ID: https://ampcode.com/threads/T-01a18970-577e-71a8-83e8-89de63b0ea68
marcleblanc2
force-pushed
the
marc/spellcheck-allow-command
branch
from
October 29, 2026 23:36
ea79e21 to
7df6d2e
Compare
Amp-Thread-ID: https://ampcode.com/threads/T-01a18970-577e-71a8-83e8-89de63b0ea68 Co-authored-by: Amp <amp@ampcode.com>
This branch was successfully deployed
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.
PR authors / reviewers can now comment on PRs with
/spell <list of words>to add words to the CSpell allowlist.
The spell check's summary and inline comments have been updated to inform the author the command exists.
Screenshots
issue_commentworkflows only run from the default branch, so this PR cannot exercise itself; these are from a PR on a fork with this branch as its main, in the order they happen.1. The spell check finds words: summary comment
The last line lists every flagged word, ready to paste.
2. The spell check finds words: inline review comment
Each flagged line gets the suggestion, and the
/spellcommand for that word.3. The author comments
/spell <word>The command comment gets a 👍, and the bot's commit lands on the branch. The checks run again on the new revision, and the summary comment updates to what is left.
4. No spelling errors remain
The summary comment turns green, and the check minimizes it as resolved; the inline comments are resolved too.
5.
/spellwith nothing to addWhen CSpell already accepts every word given, the bot replies instead of committing.
How it works
.github/workflows/spellcheck-allow.ymlruns onissue_commentandpull_request_review_commentwhose body starts with/spell(or/spell allow), on a pull request, from someone with write access. Words are separated by spaces or commas; only the comment's first line is read.dev/allow-spelling-words.mjshands the words to CSpell and adds the parts it flags, so hyphenated, snake_case, and camelCase input is split the way CSpell splits a document, and words CSpell already accepts are left out. They go into the# Wordssection ofcspell-allow-list.txt, in the orderdev/check-spelling.mjsenforces. It works locally too:node dev/allow-spelling-words.mjs <words>.github-actions[bot]. A push made withGITHUB_TOKENleaves thepull_requestruns it creates waiting for approval, so the workflow hasactions: writeand approves each one, and every check reports on the new revision.GITHUB_TOKENcannot push to a fork), as does a commenter without write access. Any other failure is replied with a link to the job log.Test plan
All on the fork, with the final workflow:
/spell <word>in the PR conversation: 👍, bot commit, all sixpull_requestruns approved and completed on the new revision, summary comment updated to the remaining findings/spell <word>as a reply to an inline review comment: 👍 on the review comment, bot commit/spell allow <word>, <word>: both added/spell <hyphenated-word>, <snake_case_word> <camelCaseWord>: only the parts CSpell flags are added/spell <accepted word>: reply, no commitactionlinton the workflow;node dev/check-spelling.mjs --base HEADreports no order issues after insertion