You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(lint): validate cspell-words.txt alphabetical sorting and duplicates - #486
…mmit
Add scripts/check-cspell-words.ts and test suite to verify cspell-words.txt
is alphabetically sorted and contains no duplicate words (case-insensitive).
Wire check into lefthook pre-commit and npm run lint:spelling:words.
Sort existing unsorted entries in cspell-words.txt.
Closes#478
Reviewing files that changed from the base of the PR and between 0e5c065 and 72ae039.
You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.
Use the checkbox below for a quick retry:
Trigger review
No actionable comments were generated in the recent review.
Walkthrough
The pull request adds a checker for duplicate and unsorted entries in cspell-words.txt, updates the word list, and connects validation to spelling lint and pre-commit hooks.
Changes: Word-list validation
Layer / File(s)
Summary
Implement and test word-list validation scripts/check-cspell-words.ts, scripts/check-cspell-words.test.ts
The validator skips blank and comment lines, detects case-insensitive duplicates, and checks ASCII ordering. Tests cover valid lists, duplicates, and unsorted entries.
Update the spelling dictionary cspell-words.txt
The word list gains entries in alphabetic positions. The appended block of entries is removed.
Run validation from lint and pre-commit package.json, lefthook.yml
The spelling lint command runs the validator after cspell. Lefthook runs it when cspell-words.txt is staged.
dpologdvinity/daydaze#348: Adds entries to the same dictionary file, which this pull request now validates for ordering and duplicates.
Merge Risk: Minimal · previous review 0e5c0
This change adds a check that rejects duplicate or unsorted spelling-dictionary entries, running in spelling lint and in pre-commit when the dictionary is staged. It affects only developer tooling and no production behavior. No merge-blocking risk was identified.
Security architecture risk: Minimal · up to 0e5c0
The change adds a read-only dictionary check to spelling lint and pre-commit. It does not change the application’s runtime, permissions, or stored state.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the main change: validation of cspell-words.txt for alphabetical sorting and duplicate entries. It matches the changeset and PR objectives. The title is 72 characters, which is slightl…
Description check
The description covers the required intent and the main changes: the new validation script and tests, the pre-commit hook, the lint:spelling update, and the sorted word list. It also lists how the cha…
Linked Issues check
Issue #478 requires a check, in scripts/check-cspell-words.ts or the Lefthook config, that verifies sorting and uniqueness of cspell-words.txt. At head, validateCspellWords in scripts/check-cspell-wor…
Out of Scope Changes check
All changed files map to #478. scripts/check-cspell-words.ts and its test file implement the validation. lefthook.yml and package.json wire the validation into pre-commit and lint:spelling. cspell-wor…
Full details: Title check
Explanation
The title names the main change: validation of cspell-words.txt for alphabetical sorting and duplicate entries. It matches the changeset and PR objectives. The title is 72 characters, which is slightly long but still clear.
Full details: Description check
Explanation
The description covers the required intent and the main changes: the new validation script and tests, the pre-commit hook, the lint:spelling update, and the sorted word list. It also lists how the change was checked and links issue #478. The template's 'What and why' and 'How it was checked' sections are present. The template's other checklist items are not addressed: the npm run verify result, Playwright tests, screenshots, and the docs/assets.md and src/game/credits.ts asset recording. Those items may not apply to this change, but the author does not mark them as not applicable.
Resolution
Optionally state whether npm run verify was run, and mark the Playwright, screenshot, and asset-recording items as not applicable, or check them off if they apply.
Full details: Linked Issues check
Explanation
Issue #478 requires a check, in scripts/check-cspell-words.ts or the Lefthook config, that verifies sorting and uniqueness of cspell-words.txt. At head, validateCspellWords in scripts/check-cspell-words.ts ignores blank and # comment lines, reports duplicates case-insensitively with line numbers, and reports adjacent entries where the current word compares greater than the next word. Its CLI mode exits with status 1 on failure. lefthook.yml adds a cspell-words job (glob cspell-words.txt) that runs node --experimental-strip-types scripts/check-cspell-words.ts. package.json adds lint:spelling:words to lint:spelling. The unit tests in scripts/check-cspell-words.test.ts cover sorted input, duplicates, case-insensitive duplicates, and unsorted entries. Sorting uses ASCII code-point order, not locale-aware alphabetical order. The issue does not specify a collation, so this is a reasonable reading. Not verified: the test run result (5/5) is reported by the author and was not re-executed here.
Full details: Out of Scope Changes check
Explanation
All changed files map to #478. scripts/check-cspell-words.ts and its test file implement the validation. lefthook.yml and package.json wire the validation into pre-commit and lint:spelling. cspell-words.txt changes are +176/-176 lines, consistent with moving existing entries into sorted positions as the PR description states. The AI-generated summary says the file 'adds many dictionary entries', but equal addition and deletion counts indicate reordering, not new vocabulary. Full word-level diff of cspell-words.txt was not inspected, so this is inferred from line counts and the PR description.
Finishing Touches
Generate unit tests (beta)
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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
area: ciCI and toolingbugSomething isn't workingeffort: lowLow reasoning effortmodel: gemini-3.8-flashAntigravity (Gemini 3.8 Flash): small visual/UI/CI/logic fixes; no GitHub, Blender or Meshy MCP
1 participant
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.
What & Why
Validates
cspell-words.txtalphabetical ordering and prevents duplicate word additions.scripts/check-cspell-words.tsand unit tests inscripts/check-cspell-words.test.tsto enforce unique, sorted words incspell-words.txt.cspell-wordsjob tolefthook.ymlpre-commit hook.lint:spelling:wordstonpm run lint:spellinginpackage.json.cspell-words.txt.How Checked
node --experimental-strip-types --test scripts/check-cspell-words.test.ts(5/5 passed)npx lefthook run pre-commit --file=cspell-words.txtnpm run lint:spellingCloses #478
Summary by CodeRabbit