Added spell checking functionality to pre-commit hooks and Makefile.#2898
Added spell checking functionality to pre-commit hooks and Makefile.#2898Prateekshit73 wants to merge 14 commits into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (2)
Summary by CodeRabbit
WalkthroughAdds cspell-based spellchecking: Dockerized cspell CLI, configs, dictionaries, Makefile and Windows batch targets, a Python tool to sort the custom dictionary, CI job, and integrates a Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Review rate limit: 7/8 reviews remaining, refill in 7 minutes and 30 seconds.Comment |
There was a problem hiding this comment.
Actionable comments posted: 27
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
make.cmd (1)
13-19: Fail fast on errors in :Check.Right now, a later success can mask earlier failures (e.g., spellcheck failing but tests passing). Propagate ERRORLEVEL after each step.
Apply:
:Check - Call :L10n - Call :Pre-commit - Call :Doc - Call :Spellcheck - Call :Test - Exit /B + Call :L10n & If ErrorLevel 1 Exit /B %ERRORLEVEL% + Call :Pre-commit & If ErrorLevel 1 Exit /B %ERRORLEVEL% + Call :Doc & If ErrorLevel 1 Exit /B %ERRORLEVEL% + Call :Spellcheck & If ErrorLevel 1 Exit /B %ERRORLEVEL% + Call :Test & Exit /B %ERRORLEVEL%
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
⛔ Files ignored due to path filters (1)
cspell/package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (11)
.pre-commit-config.yaml(1 hunks)Makefile(2 hunks)cspell/Dockerfile(1 hunks)cspell/Makefile(1 hunks)cspell/cspell.json(1 hunks)cspell/custom-dict.txt(1 hunks)cspell/dictionaries/hindi/hi.txt(1 hunks)cspell/dictionaries/hindi/package.json(1 hunks)cspell/make.cmd(1 hunks)cspell/package.json(1 hunks)make.cmd(2 hunks)
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: PPsyrius
PR: vacanza/holidays#2398
File: holidays/groups/islamic.py:301-301
Timestamp: 2025-04-01T14:14:01.519Z
Learning: Running `make pre-commit` in the holidays project can automatically fix common code style issues like whitespace in blank lines.
🪛 checkmake (0.2.2)
cspell/Makefile
[warning] 1-1: Missing required phony target "all"
(minphony)
[warning] 1-1: Missing required phony target "clean"
(minphony)
[warning] 1-1: Missing required phony target "test"
(minphony)
Makefile
[warning] 3-3: Missing required phony target "all"
(minphony)
[warning] 3-3: Missing required phony target "clean"
(minphony)
[warning] 3-3: Missing required phony target "test"
(minphony)
🪛 Checkov (3.2.334)
cspell/Dockerfile
[LOW] 1-24: Ensure that HEALTHCHECK instructions have been added to container images
(CKV_DOCKER_2)
🔇 Additional comments (4)
cspell/custom-dict.txt (1)
1-33: Ensure CI invokes thesort-custom-dictpre-commit hook
Thesort-custom-dicthook is already defined in.pre-commit-config.yamland runs when you runmake pre-commit(which callspre-commit run --all-files). Confirm that your CI pipeline also runs this target (orpre-commit run --all-files) socspell/custom-dict.txtstays consistently sorted and deduped.Makefile (1)
14-14: Help text vs actual scope mismatch.Help says “localization and documentation files” but the config scans broadly. Update help or cspell.json (see cspell.json comment).
.pre-commit-config.yaml (2)
78-81: Confirm whether case-insensitive dedupe is desired.The current
sort -f | uniq -ican drop intentionally cased entries (e.g., “US” vs “Us”). If casing matters for your custom dict, switch to case-sensitive dedupe.- entry: bash -c '... sort -f --stable | LC_ALL=C uniq -i >> ...' + entry: bash -c '... sort --stable | LC_ALL=C uniq >> ...'
75-75: Good: pinned cspell version.Pinning
cspell@8.19.4ensures reproducibility across contributors.
| hooks: | ||
| - id: cspell | ||
| name: cspell | ||
| entry: cspell --config ./cspell/cspell.json |
There was a problem hiding this comment.
🧹 Nitpick (assertive)
Quiet, faster cspell runs.
Trim noise and speed up CI with caching and no-progress output.
- entry: cspell --config ./cspell/cspell.json
+ entry: cspell --config ./cspell/cspell.json --no-progress --cacheAdd .cspellcache to .gitignore if not already ignored.
📝 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.
| entry: cspell --config ./cspell/cspell.json | |
| entry: cspell --config ./cspell/cspell.json --no-progress --cache |
🤖 Prompt for AI Agents
In .pre-commit-config.yaml around line 72, the cspell pre-commit entry is noisy
and slow; update the entry to run cspell with quiet/no-progress and caching by
adding the flags --no-progress and --cache to the command (e.g. cspell --config
./cspell/cspell.json --no-progress --cache) so CI is faster and less verbose,
and add .cspellcache to .gitignore (if not already present) to avoid committing
the cache file.
| - id: cspell | ||
| name: cspell | ||
| entry: cspell --config ./cspell/cspell.json | ||
| files: \.(py|md|rst|txt|yml|yaml|po|ini|cfg|conf|env|toml|json|properties|xml)$ |
There was a problem hiding this comment.
🧹 Nitpick (assertive)
Broaden file patterns (optional).
If you want spellcheck on scripts and build files too, include these.
- files: \.(py|md|rst|txt|yml|yaml|po|ini|cfg|conf|env|toml|json|properties|xml)$
+ files: (^Dockerfile$|\.((py|md|rst|txt|yml|yaml|po|ini|cfg|conf|env|toml|json|properties|xml|sh|bash|bat|cmd|ps1|mk))$)📝 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.
| files: \.(py|md|rst|txt|yml|yaml|po|ini|cfg|conf|env|toml|json|properties|xml)$ | |
| files: (^Dockerfile$|\.((py|md|rst|txt|yml|yaml|po|ini|cfg|conf|env|toml|json|properties|xml|sh|bash|bat|cmd|ps1|mk))$) |
🤖 Prompt for AI Agents
In .pre-commit-config.yaml at line 73, the files regex only covers common
text/code extensions and omits scripts and build files; update the pattern to
also match shell and scripting extensions and common build filenames (e.g., add
\.(sh|bash|zsh|ps1|gradle|mk)$ and include literal filenames like ^Dockerfile$
and ^Makefile$ or their variants) so the spellcheck hook runs on scripts and
build files too; modify the files entry to combine the existing extensions with
these additional patterns (using alternation or a second hook entry) ensuring
YAML syntax and proper escaping.
| files: \.(py|md|rst|txt|yml|yaml|po|ini|cfg|conf|env|toml|json|properties|xml)$ | ||
| language: node | ||
| additional_dependencies: ["cspell@8.19.4"] | ||
| exclude: ^(docs/_build|node_modules|\.venv|__pycache__|dist|build|\.mypy_cache|\.pytest_cache|\.egg-info|\.tox|snapshots)/$ |
There was a problem hiding this comment.
Fix exclude regex so directories are actually excluded.
The $ forces a full-string match and won’t exclude files inside those dirs. Use a prefix match that ends with a slash.
- exclude: ^(docs/_build|node_modules|\.venv|__pycache__|dist|build|\.mypy_cache|\.pytest_cache|\.egg-info|\.tox|snapshots)/$
+ exclude: ^(docs/_build|node_modules|\.venv|__pycache__|dist|build|\.mypy_cache|\.pytest_cache|\.egg-info|\.tox|snapshots)/🤖 Prompt for AI Agents
In .pre-commit-config.yaml around line 76, the exclude regex uses a trailing $
which matches only the exact directory path and therefore won't exclude files
inside those directories; change the pattern to use a prefix match that ends
with a slash (e.g. remove the trailing $ and ensure the directory list is
followed by /) so the regex excludes any path that begins with those directories
rather than only the directory name itself.
| name: sort and uniquify custom-dict.txt | ||
| entry: bash -c 'LC_ALL=C grep "^#" cspell/custom-dict.txt > cspell/custom-dict.txt.tmp && LC_ALL=C grep -v "^#" cspell/custom-dict.txt | grep -v "^[[:space:]]*$" | LC_ALL=C sort -f --stable | LC_ALL=C uniq -i >> cspell/custom-dict.txt.tmp && mv cspell/custom-dict.txt.tmp cspell/custom-dict.txt' | ||
| files: ^cspell/custom-dict\.txt$ | ||
| language: system |
There was a problem hiding this comment.
🛠️ Refactor suggestion
Make the dict sorter cross‑platform (drop bash).
This hook will fail on Windows shells. Use a tiny Python hook instead.
- - id: sort-custom-dict
- name: sort and uniquify custom-dict.txt
- entry: bash -c 'LC_ALL=C grep "^#" cspell/custom-dict.txt > cspell/custom-dict.txt.tmp && LC_ALL=C grep -v "^#" cspell/custom-dict.txt | grep -v "^[[:space:]]*$" | LC_ALL=C sort -f --stable | LC_ALL=C uniq -i >> cspell/custom-dict.txt.tmp && mv cspell/custom-dict.txt.tmp cspell/custom-dict.txt'
- files: ^cspell/custom-dict\.txt$
- language: system
+ - id: sort-custom-dict
+ name: sort and uniquify custom-dict.txt
+ entry: python tools/sort_cspell_dict.py
+ files: ^cspell/custom-dict\.txt$
+ language: python
+ pass_filenames: falseAdd at tools/sort_cspell_dict.py:
#!/usr/bin/env python
from pathlib import Path
p = Path("cspell/custom-dict.txt")
comments, words = [], []
for line in p.read_text(encoding="utf-8").splitlines():
if line.startswith("#"):
comments.append(line)
else:
s = line.strip()
if s:
words.append(s)
# Case-sensitive sort+dedupe to preserve intentional casing
seen, out = set(), []
for w in sorted(words):
if w not in seen:
seen.add(w)
out.append(w)
p.write_text("\n".join([*comments, *out]) + "\n", encoding="utf-8")🤖 Prompt for AI Agents
In .pre-commit-config.yaml around lines 78 to 81, the current hook uses a bash
one-liner which will fail on Windows; replace it with a cross-platform tiny
Python script and call that from the hook. Add the script
tools/sort_cspell_dict.py (as described in the review) that reads
cspell/custom-dict.txt, preserves comment lines, strips/filters blank lines,
sorts and deduplicates words while preserving case, and rewrites the file with a
trailing newline; make the script executable and committed. Then update the hook
entry to invoke the script with the system language (e.g., entry: python3
tools/sort_cspell_dict.py or use {python} from pre-commit) and keep files:
^cspell/custom-dict\.txt$ so the hook runs cross-platform.
| :Spellcheck | ||
| call cspell\make.cmd cspell-check | ||
| Exit /B %ERRORLEVEL% |
There was a problem hiding this comment.
🧹 Nitpick (assertive)
Make the Spellcheck call path-safe.
Use script-dir anchored path to survive spaces/symlinks.
Apply:
:Spellcheck
- call cspell\make.cmd cspell-check
+ call "%~dp0cspell\make.cmd" cspell-check
Exit /B %ERRORLEVEL%📝 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.
| :Spellcheck | |
| call cspell\make.cmd cspell-check | |
| Exit /B %ERRORLEVEL% | |
| :Spellcheck | |
| call "%~dp0cspell\make.cmd" cspell-check | |
| Exit /B %ERRORLEVEL% |
🤖 Prompt for AI Agents
In make.cmd around lines 21 to 23, the call to cspell\make.cmd is not path-safe;
replace it with a script-dir anchored, quoted path using the batch %~dp0
variable (e.g. call "%~dp0cspell\make.cmd") so the command survives spaces and
symlinks, then keep the existing Exit /B %ERRORLEVEL% unchanged.
| -include cspell/Makefile | ||
|
|
||
| .PHONY: spellcheck | ||
|
|
There was a problem hiding this comment.
🧹 Nitpick (assertive)
Declare common phony targets (quiet checkmake).
- .PHONY: spellcheck
+.PHONY: all clean test spellcheck help doc l10n package pre-commit setup release-notes sbom snapshot tox check🧰 Tools
🪛 checkmake (0.2.2)
[warning] 3-3: Missing required phony target "all"
(minphony)
[warning] 3-3: Missing required phony target "clean"
(minphony)
[warning] 3-3: Missing required phony target "test"
(minphony)
🤖 Prompt for AI Agents
In Makefile around lines 1 to 4, the .PHONY declaration only lists spellcheck;
expand it to declare common phony targets so checkmake and quiet (and other
frequently used phony targets) are recognized. Update the .PHONY line to include
spellcheck, checkmake, quiet and any other repository-standard phony targets
such as all, test, clean, etc., ensuring the Makefile consistently declares
every non-file-producing target as phony.
|
It still reports 25,729 unknown words. Should I add custom dictionaries like I did for Hindi, or is there another recommended workaround? |
| "path": "custom-dict.txt" | ||
| }, | ||
| { | ||
| "name": "hi", |
There was a problem hiding this comment.
This is not what we want. Try resolving it with existing dictionaries.
There was a problem hiding this comment.
I have already included every available dictionary as a dependency. Here is the complete list for reference:
Natural Language Dictionaries
| } | ||
| ], | ||
| "dictionaries": [ | ||
| "ar", |
There was a problem hiding this comment.
My understanding is that all of them need to be installed as dependencies.
| hooks: | ||
| - id: tox-ini-fmt | ||
|
|
||
| - repo: local |
There was a problem hiding this comment.
Make it part of make check instead
| "node_modules/**", | ||
| ".git/**", | ||
| ".venv/**", | ||
| "__pycache__/**", | ||
| "*.pyc", | ||
| "dist/**", | ||
| "build/**", | ||
| ".mypy_cache/**", | ||
| ".pytest_cache/**", | ||
| "docs/_build/**", | ||
| "snapshots/**", | ||
| "*.egg-info/**", | ||
| ".tox/**", | ||
| "requirements/*.txt", | ||
| "cspell/dictionaries/**" |
There was a problem hiding this comment.
Which of these do you consider unnecessary or redundant? Should I remove any specific ones?
…teekshit73/holidays into comprehensive-spell-checking
There was a problem hiding this comment.
Actionable comments posted: 14
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
.pre-commit-config.yaml (1)
68-78: Spellcheck isn’t integrated into pre-commit (only pre-push).Issue #2308 asks for pre-commit integration. Add a lightweight hook that runs your Make target (no filenames) at pre-commit so contributors get feedback before push.
Apply:
- repo: local hooks: - id: tests always_run: true entry: make check language: system name: run `make check` pass_filenames: false stages: - pre-push + - id: spellcheck + name: cspell (docs + l10n) + entry: make -s spellcheck + language: system + pass_filenames: false + stages: + - pre-commitMakefile (1)
32-37: Also clean cspell cache.Keeps tree tidy.
@rm -rf .mypy_cache .pytest_cache dist .tox + @rm -f .cspellcache
♻️ Duplicate comments (7)
make.cmd (3)
21-23: Anchor Python path to script dir (Windows path safety).Avoid failures when repo path contains spaces/symlinks.
:Sort-custom-dict - python tools/sort_cspell_dict.py + call python "%~dp0tools\sort_cspell_dict.py" Exit /B
25-28: Quote and anchor cspell\make.cmd call.Same path-safety fix.
:Spellcheck call :Sort-custom-dict - call cspell\make.cmd cspell-check + call "%~dp0cspell\make.cmd" cspell-check Exit /B %ERRORLEVEL%
45-46: Help text mismatches scope.cspell currently scans docs + l10n (per cspell.json), not “code”. Update help or expand cspell “files”.
- Echo spellcheck run spell check across the repository (code, docs, l10n) + Echo spellcheck run spell check on documentation and localization filescspell/cspell.json (1)
101-101: Remove overbroad “Capitalized Word Pair” ignore.This hides real typos in titles (e.g., “Nwe Year”).
- "\\b[A-Z][a-z]+\\s+[A-Z][a-z]+\\b", + // removed: too broad and hides legitimate typosMakefile (1)
3-3: Declare all common PHONY targets.Avoid checkmake warnings and accidental file/target collisions.
-.PHONY: spellcheck +.PHONY: all clean test spellcheck help doc l10n package pre-commit setup release-notes sbom snapshot tox check sort-custom-dictcspell/Makefile (1)
12-13: Missing prerequisite target ‘cspell-run’ breaks make.
cspell-checkdepends oncspell-runbut it’s undefined → “No rule to make target…”.cspell-check: CMD=--no-progress -r /holidays -cspell-check: cspell-install cspell-run +cspell-check: cspell-install cspell-run + +# placeholder to satisfy dependency (extend later if needed) +cspell-run: + @truecspell/package.json (1)
1-12: Mark package private; make this a pure tooling package.Prevents accidental publish, removes unused entry point, and puts tooling under devDependencies.
Apply:
{ "name": "cspell-check", + "private": true, "version": "1.0.0", "description": "Spell checking for holidays project", - "main": "index.js", "scripts": { "spellcheck": "cspell" }, - "dependencies": { + "devDependencies": {
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
⛔ Files ignored due to path filters (1)
cspell/package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (9)
.pre-commit-config.yaml(2 hunks)Makefile(2 hunks)cspell/Makefile(1 hunks)cspell/cspell.json(1 hunks)cspell/custom-dict.txt(1 hunks)cspell/make.cmd(1 hunks)cspell/package.json(1 hunks)make.cmd(2 hunks)tools/sort_cspell_dict.py(1 hunks)
🧰 Additional context used
🪛 checkmake (0.2.2)
cspell/Makefile
[warning] 1-1: Missing required phony target "all"
(minphony)
[warning] 1-1: Missing required phony target "clean"
(minphony)
[warning] 1-1: Missing required phony target "test"
(minphony)
Makefile
[warning] 3-3: Missing required phony target "all"
(minphony)
[warning] 3-3: Missing required phony target "clean"
(minphony)
[warning] 3-3: Missing required phony target "test"
(minphony)
🔇 Additional comments (3)
.pre-commit-config.yaml (2)
23-23: Indentation fix for pyupgrade looks good.No functional concerns here.
64-64: Quoting tox-ini-fmt rev is fine.Safe, no action needed.
cspell/Makefile (1)
3-10: Build step LGTM.Context and flags are correct; honors FORCE.
| "dictionaries": [ | ||
| "ar", | ||
| "bg-bg", | ||
| "bn", | ||
| "ca", | ||
| "companies", | ||
| "cs-cz", | ||
| "da-dk", | ||
| "de-at", | ||
| "de-ch", | ||
| "de-de", | ||
| "el", | ||
| "en_us", | ||
| "en-au", | ||
| "en-ca", | ||
| "en-common-misspellings", | ||
| "en-gb", | ||
| "eo", | ||
| "es-es", | ||
| "et-ee", | ||
| "eu", | ||
| "fa-ir", | ||
| "fi-fi", | ||
| "fr-fr", | ||
| "gd", | ||
| "gl-es", | ||
| "grc", | ||
| "he", | ||
| "hr-hr", | ||
| "hu-hu", | ||
| "hy", | ||
| "id-id", | ||
| "it-it", | ||
| "la", | ||
| "lt-lt", | ||
| "lv", | ||
| "makefile", | ||
| "markdown", | ||
| "mk", | ||
| "mn-mn", | ||
| "nb-no", | ||
| "nl-nl", | ||
| "pl-pl", | ||
| "pt-br", | ||
| "pt-pt", | ||
| "python", | ||
| "ro-ro", | ||
| "ru-ru", | ||
| "scientific-terms-gb", | ||
| "sk-sk", | ||
| "sl-si", | ||
| "sr-cyrl", | ||
| "sr-latn", | ||
| "sv", | ||
| "software-terms", | ||
| "tr-tr", | ||
| "uk-ua", | ||
| "vi-vn", | ||
| "custom-dict" | ||
| ], |
There was a problem hiding this comment.
🧹 Nitpick (assertive)
Right-size dictionary set to reduce noise.
Enabling dozens of dictionaries globally increases false positives/negatives. Consider limiting to locales you actually ship and adding others incrementally.
Would you like a PR-ready matrix that maps repo locales to the minimal cspell-dict set?
🤖 Prompt for AI Agents
In cspell/cspell.json around lines 13 to 72, the file enables a very large
global dictionary list that increases noise; trim this list to just the language
dictionaries your app actually ships plus shared dictionaries (e.g., keep en-us
or en-gb depending on product locale, and retain essential global lists like
software-terms, makefile, markdown, python, custom-dict), remove all other
locale-specific dictionaries, and document any removed locales in a comment so
contributors can add them back via a per-folder or per-package cspell.json
when/if those locales are introduced.
| "node_modules/**", | ||
| ".git/**", | ||
| ".venv/**", | ||
| "__pycache__/**", | ||
| "*.pyc", | ||
| "dist/**", | ||
| "build/**", | ||
| ".mypy_cache/**", | ||
| ".pytest_cache/**", | ||
| "docs/_build/**", | ||
| "snapshots/**", | ||
| "*.egg-info/**", | ||
| ".tox/**", | ||
| "requirements/*.txt", | ||
| "cspell/dictionaries/**" | ||
| ], |
There was a problem hiding this comment.
🧹 Nitpick (assertive)
Ignore more noisy caches and tool dirs.
Reduce false positives and scan time.
"ignorePaths": [
"node_modules/**",
".git/**",
".venv/**",
+ ".direnv/**",
"__pycache__/**",
"*.pyc",
"dist/**",
"build/**",
".mypy_cache/**",
".pytest_cache/**",
+ ".ruff_cache/**",
+ ".github/**",
+ ".vscode/**",
+ ".idea/**",
"docs/_build/**",
"snapshots/**",
"*.egg-info/**",
".tox/**",
"requirements/*.txt",
+ "requirements/**/*.txt",
"cspell/dictionaries/**"
],🤖 Prompt for AI Agents
In cspell/cspell.json around lines 81 to 96, the ignore list is missing common
noisy caches and editor/tool directories which cause false positives and slower
scans; add entries such as ".vscode/**", ".idea/**", ".cache/**", "coverage/**",
"vendor/**", "target/**", ".terraform/**", ".gradle/**", ".bundle/**",
".sass-cache/**", ".DS_Store", ".history/**", ".parcel-cache/**", ".next/**",
"out/**" to the existing array so these directories and files are skipped by the
spellchecker; ensure patterns include /** where appropriate and keep the list
sorted/consistent with existing entries.
| "cspell": "^8.19.4" | ||
| } |
There was a problem hiding this comment.
💡 Verification agent
🧩 Analysis chain
Align version pinning strategy with pre-commit.
Pre-commit often pins exact versions (e.g., cspell@8.19.4). Here you use a caret. Pick one strategy for both to avoid drift.
Run to compare versions:
🏁 Script executed:
#!/bin/bash
set -euo pipefail
pre_commit_ver="$(rg -nP 'cspell@(\d+\.\d+\.\d+)' .pre-commit-config.yaml -or '$1' | head -n1 || true)"
pkg_ver="$(jq -r '.devDependencies.cspell // .dependencies.cspell' cspell/package.json | sed 's/^[^0-9]*//')"
echo "pre-commit cspell: ${pre_commit_ver:-<none>}"
echo "package.json cspell: ${pkg_ver:-<none>}"
test -n "${pre_commit_ver}" && test -n "${pkg_ver}" && [ "$pre_commit_ver" = "$pkg_ver" ] && echo "OK: versions match" || echo "MISMATCH: consider pinning consistently"Length of output: 93
Align cspell version pinning between pre-commit and package.json
- cspell/package.json (lines ~65–66) uses "^8.19.4"; .pre-commit-config.yaml contains no cspell pin (script: pre-commit cspell: ; package.json cspell: 8.19.4 → MISMATCH).
- Action: either pin the exact version in package.json (remove caret) or add the same exact rev/version to .pre-commit-config.yaml so both use the same version.
🤖 Prompt for AI Agents
In cspell/package.json around lines 65–66 the cspell dependency is specified as
"^8.19.4", which mismatches the unpinned cspell usage in
.pre-commit-config.yaml; fix by making both use the identical exact version:
either remove the caret in cspell/package.json to pin "8.19.4" exactly, or
update .pre-commit-config.yaml to reference the same explicit cspell
revision/version (8.19.4); ensure both files are updated so they match exactly
and run a quick install or pre-commit check to verify consistency.
| spellcheck: sort-custom-dict | ||
| @command -v docker >/dev/null 2>&1 || { echo "ERROR: docker not found. Install Docker or skip spellcheck."; exit 127; } | ||
| $(MAKE) cspell-check | ||
|
|
There was a problem hiding this comment.
🧹 Nitpick (assertive)
Optional: enable caching to speed up repeated checks.
Mount cache via cspell/Makefile; ensure .cspellcache is ignored.
spellcheck: sort-custom-dict
@command -v docker >/dev/null 2>&1 || { echo "ERROR: docker not found. Install Docker or skip spellcheck."; exit 127; }
- $(MAKE) cspell-check
+ $(MAKE) cspell-check CMD='--no-progress --cache --cache-location /holidays/.cspellcache -r /holidays'📝 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.
| spellcheck: sort-custom-dict | |
| @command -v docker >/dev/null 2>&1 || { echo "ERROR: docker not found. Install Docker or skip spellcheck."; exit 127; } | |
| $(MAKE) cspell-check | |
| spellcheck: sort-custom-dict | |
| @command -v docker >/dev/null 2>&1 || { echo "ERROR: docker not found. Install Docker or skip spellcheck."; exit 127; } | |
| $(MAKE) cspell-check CMD='--no-progress --cache --cache-location /holidays/.cspellcache -r /holidays' |
🤖 Prompt for AI Agents
In Makefile around lines 28-31, the spellcheck target should be updated to
enable caching for faster repeated runs: modify the docker invocation used by
cspell-check to mount a host cache directory (and the .cspellcache file) into
the container as volumes (e.g., map a repo-local .cspellcache and a
.cache/cspell or similar path) so cspell can reuse results across runs, and
update repository ignores to include .cspellcache if not already ignored; ensure
the Makefile preserves the existing docker-not-found check and exits
appropriately when docker is missing.
There was a problem hiding this comment.
Actionable comments posted: 9
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
.pre-commit-config.yaml (1)
68-78: Add a lightweight cspell hook at pre-commit (optional, faster feedback).Right now cspell runs via make check on pre-push. Consider a dedicated pre-commit hook that scans only staged files with cache to reduce noise and catch issues earlier.
Proposed addition:
+ - repo: local + hooks: + - id: cspell + name: cspell (staged files) + entry: cspell --config ./cspell/cspell.json --no-progress --cache + language: system + pass_filenames: true + stages: [pre-commit] + files: '(^Dockerfile$|^Makefile$|\.((py|md|rst|txt|yml|yaml|po|ini|cfg|conf|env|toml|json|properties|xml|sh|bash|bat|cmd|ps1|mk))$)' + exclude: ^(docs/_build|node_modules|\.venv|\.direnv|__pycache__|dist|build|\.mypy_cache|\.pytest_cache|\.ruff_cache|\.egg-info|\.tox|snapshots|\.git|\.vscode|\.idea)/
♻️ Duplicate comments (6)
cspell/cspell.json (2)
101-101: Remove overbroad “Capitalized Word Pair” ignore; it hides real typos.This regex suppresses many legitimate errors (e.g., “Nwe Year”). It was previously flagged; looks reintroduced.
Apply:
- "\\b[A-Z][a-z]+\\s+[A-Z][a-z]+\\b", + // Removed: too broad and hides real typos in titles.
97-105: Tighten ignore patterns for PO placeholders (optional).Add patterns for gettext-style placeholders to cut noise.
Apply:
"ignoreRegExpList": [ "#\\w+", "<@\\w+>", "\\b[A-Z]{2,}\\b", - "\\b[A-Z][a-z]+\\s+[A-Z][a-z]+\\b", "\\b\\d+\\b", "\\b[A-Za-z]+_[A-Za-z]+\\b", - "\\bhttps?:\\/\\/[^\\s]+\\b" + "\\bhttps?:\\/\\/[^\\s]+\\b", + "%\\([A-Za-z_][A-Za-z0-9_]*\\)s", // gettext named placeholders + "%[sd]%", // stray percent tokens + "%[sd]" // printf-style placeholders ],Makefile (1)
3-3: Declare all phony targets (silence checkmake; clearer UX).Apply:
-.PHONY: spellcheck +.PHONY: all clean test spellcheck help doc l10n package pre-commit setup release-notes sbom snapshot tox check sort-custom-dictmake.cmd (1)
21-28: Make Windows calls path-safe and robust.Apply:
:Sort-custom-dict - python tools/sort_cspell_dict.py + python "%~dp0tools\sort_cspell_dict.py" Exit /B :Spellcheck call :Sort-custom-dict - call cspell\make.cmd cspell-check + call "%~dp0cspell\make.cmd" cspell-check Exit /B %ERRORLEVEL%cspell/Makefile (1)
11-17: Missing cspell-run target breaks dependency chain.Add a no-op target or drop it from prerequisites.
-cspell-check: cspell-install cspell-run +cspell-check: cspell-install cspell-run + +cspell-run: + @trueAlternatively:
-cspell-check: cspell-install cspell-run +cspell-check: cspell-installcspell/package.json (1)
1-7: Mark package as private and drop unnecessary "main".This is a tooling-only package; avoid accidental publish and remove unused entry point.
Apply:
"version": "1.0.0", "description": "Spell checking for holidays project", - "main": "index.js", + "private": true,
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
⛔ Files ignored due to path filters (1)
cspell/package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (9)
.pre-commit-config.yaml(2 hunks)Makefile(2 hunks)cspell/Makefile(1 hunks)cspell/cspell.json(1 hunks)cspell/custom-dict.txt(1 hunks)cspell/make.cmd(1 hunks)cspell/package.json(1 hunks)make.cmd(2 hunks)tools/sort_cspell_dict.py(1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: PPsyrius
PR: vacanza/holidays#2608
File: holidays/locale/en_US/LC_MESSAGES/VC.po:76-76
Timestamp: 2025-06-10T05:08:07.939Z
Learning: For the holidays project, localization file formatting issues (like missing terminal periods in .po files) should be automatically fixed by running `make l10n` command (which is included in `make check`). Authors should be directed to use this automated tooling instead of manual formatting fixes.
🪛 checkmake (0.2.2)
cspell/Makefile
[warning] 1-1: Missing required phony target "all"
(minphony)
[warning] 1-1: Missing required phony target "clean"
(minphony)
[warning] 1-1: Missing required phony target "test"
(minphony)
Makefile
[warning] 3-3: Missing required phony target "all"
(minphony)
[warning] 3-3: Missing required phony target "clean"
(minphony)
[warning] 3-3: Missing required phony target "test"
(minphony)
🔇 Additional comments (9)
.pre-commit-config.yaml (2)
23-23: Formatting-only change — OK.
64-64: Formatting-only change — OK.Makefile (1)
25-31: Good: docker presence guard and read-only bind via cspell sub-make.make.cmd (1)
42-54: Help text matches behavior — nice.cspell/Makefile (3)
3-9: Docker build context correctly set to cspell/ — good.
14-17: Good: read-only bind and explicit lint subcommand.
19-21: sort-custom-dict wired — verified.
Ran tools/sort_cspell_dict.py; it reported "Sorted and uniquified /home/jailuser/git/cspell/custom-dict.txt" and there were no diffs to cspell/custom-dict.txt — header comments remain on top.cspell/package.json (2)
1-67: No action needed — lockfile present and Docker uses npm ci.cspell/package-lock.json is committed and cspell/Dockerfile runs
npm ci --ignore-scripts --no-audit --no-fund(and copies package-lock.json), so reproducible installs are already configured.
9-66: Move all cspell tooling to devDependencies.Tooling (cspell + @cspell/* dictionaries) is dev-only — keep production installs clean. cspell/Dockerfile runs
npm ci(no omit flags); verify CI/workflows/other Dockerfiles do not install with --omit=dev / --only=prod or NODE_ENV=production.Apply:
- "dependencies": { + "devDependencies": { "@cspell/dict-ar": "^1.1.6", "@cspell/dict-bg-bg": "^3.0.8", "@cspell/dict-bn": "^1.0.3", "@cspell/dict-ca": "^3.1.2", "@cspell/dict-companies": "^3.2.5", "@cspell/dict-cs-cz": "^3.0.8", "@cspell/dict-da-dk": "^4.1.2", "@cspell/dict-de-at": "^1.2.2", "@cspell/dict-de-ch": "^1.3.2", "@cspell/dict-de-de": "^4.1.2", "@cspell/dict-el": "^3.1.8", "@cspell/dict-en-au": "^1.1.7", "@cspell/dict-en-ca": "^1.0.45", "@cspell/dict-en-common-misspellings": "^2.1.6", "@cspell/dict-en-gb": "^5.0.14", "@cspell/dict-en_us": "^4.4.19", "@cspell/dict-eo": "^3.0.7", "@cspell/dict-es-es": "^3.0.8", "@cspell/dict-et-ee": "^3.1.6", "@cspell/dict-eu": "^1.0.6", "@cspell/dict-fa-ir": "^4.0.5", "@cspell/dict-fi-fi": "^1.1.3", "@cspell/dict-fr-fr": "^2.3.2", "@cspell/dict-gd": "^1.0.3", "@cspell/dict-gl-es": "^1.1.3", "@cspell/dict-grc": "^1.0.7", "@cspell/dict-he": "^4.0.5", "@cspell/dict-hr-hr": "^3.1.2", "@cspell/dict-hu-hu": "^1.1.2", "@cspell/dict-hy": "^1.0.3", "@cspell/dict-id-id": "^1.0.7", "@cspell/dict-it-it": "^3.1.6", "@cspell/dict-la": "^1.1.2", "@cspell/dict-lt-lt": "^4.0.6", "@cspell/dict-lv": "^1.1.6", "@cspell/dict-makefile": "^1.0.5", "@cspell/dict-markdown": "^2.0.12", "@cspell/dict-mk": "^1.0.3", "@cspell/dict-mn-mn": "^1.2.2", "@cspell/dict-nb-no": "^2.0.6", "@cspell/dict-nl-nl": "^2.4.2", "@cspell/dict-pt-br": "^2.4.2", "@cspell/dict-pt-pt": "^3.0.6", "@cspell/dict-python": "^4.2.19", "@cspell/dict-ro-ro": "^2.0.6", "@cspell/dict-scientific-terms-gb": "^1.0.6", "@cspell/dict-sk-sk": "^1.1.7", "@cspell/dict-sl-si": "^1.0.11", "@cspell/dict-software-terms": "^5.1.8", "@cspell/dict-sr-cyrl": "^1.1.6", "@cspell/dict-sr-latn": "^1.0.8", "@cspell/dict-sv": "^2.3.2", "@cspell/dict-tr-tr": "^3.0.6", "@cspell/dict-uk-ua": "^4.0.6", "@cspell/dict-vi-vn": "^3.0.6", "cspell": "^8.19.4" }
| ], | ||
| "dictionaries": [ | ||
| "ar", | ||
| "bg-bg", | ||
| "bn", | ||
| "ca", | ||
| "companies", | ||
| "cs-cz", | ||
| "da-dk", | ||
| "de-at", | ||
| "de-ch", | ||
| "de-de", | ||
| "el", | ||
| "en_us", | ||
| "en-au", | ||
| "en-ca", | ||
| "en-common-misspellings", | ||
| "en-gb", | ||
| "eo", | ||
| "es-es", | ||
| "et-ee", | ||
| "eu", | ||
| "fa-ir", | ||
| "fi-fi", | ||
| "fr-fr", | ||
| "gd", | ||
| "gl-es", | ||
| "grc", | ||
| "he", | ||
| "hr-hr", | ||
| "hu-hu", | ||
| "hy", | ||
| "id-id", | ||
| "it-it", | ||
| "la", | ||
| "lt-lt", | ||
| "lv", | ||
| "makefile", | ||
| "markdown", | ||
| "mk", | ||
| "mn-mn", | ||
| "nb-no", | ||
| "nl-nl", | ||
| "pl-pl", | ||
| "pt-br", | ||
| "pt-pt", | ||
| "python", | ||
| "ro-ro", | ||
| "ru-ru", | ||
| "scientific-terms-gb", | ||
| "sk-sk", | ||
| "sl-si", | ||
| "sr-cyrl", | ||
| "sr-latn", | ||
| "sv", | ||
| "software-terms", | ||
| "tr-tr", | ||
| "uk-ua", | ||
| "vi-vn", | ||
| "custom-dict" | ||
| ], |
There was a problem hiding this comment.
🧹 Nitpick (assertive)
🛠️ Refactor suggestion
Reduce 25k+ unknowns with per-locale overrides and compounds.
Map locale folders to matching dictionaries and allow compounds for languages that need it (e.g., de, sv). This dramatically lowers false positives without bloating custom-dict.
Apply:
],
+ "overrides": [
+ { "filename": "holidays/locale/de_DE/LC_MESSAGES/*.po", "dictionaries": ["de-de"], "allowCompoundWords": true },
+ { "filename": "holidays/locale/de_AT/LC_MESSAGES/*.po", "dictionaries": ["de-at"], "allowCompoundWords": true },
+ { "filename": "holidays/locale/de_CH/LC_MESSAGES/*.po", "dictionaries": ["de-ch"], "allowCompoundWords": true },
+ { "filename": "holidays/locale/fr_FR/LC_MESSAGES/*.po", "dictionaries": ["fr-fr"] },
+ { "filename": "holidays/locale/es_ES/LC_MESSAGES/*.po", "dictionaries": ["es-es"] },
+ { "filename": "holidays/locale/pt_PT/LC_MESSAGES/*.po", "dictionaries": ["pt-pt"] },
+ { "filename": "holidays/locale/pt_BR/LC_MESSAGES/*.po", "dictionaries": ["pt-br"] },
+ { "filename": "holidays/locale/it_IT/LC_MESSAGES/*.po", "dictionaries": ["it-it"] },
+ { "filename": "holidays/locale/nl_NL/LC_MESSAGES/*.po", "dictionaries": ["nl-nl"] },
+ { "filename": "holidays/locale/sv_SE/LC_MESSAGES/*.po", "dictionaries": ["sv"], "allowCompoundWords": true },
+ { "filename": "holidays/locale/nb_NO/LC_MESSAGES/*.po", "dictionaries": ["nb-no"] },
+ { "filename": "holidays/locale/fi_FI/LC_MESSAGES/*.po", "dictionaries": ["fi-fi"] },
+ { "filename": "holidays/locale/pl_PL/LC_MESSAGES/*.po", "dictionaries": ["pl-pl"] },
+ { "filename": "holidays/locale/cs_CZ/LC_MESSAGES/*.po", "dictionaries": ["cs-cz"] },
+ { "filename": "holidays/locale/sk_SK/LC_MESSAGES/*.po", "dictionaries": ["sk-sk"] },
+ { "filename": "holidays/locale/sl_SI/LC_MESSAGES/*.po", "dictionaries": ["sl-si"] },
+ { "filename": "holidays/locale/ro_RO/LC_MESSAGES/*.po", "dictionaries": ["ro-ro"] },
+ { "filename": "holidays/locale/hu_HU/LC_MESSAGES/*.po", "dictionaries": ["hu-hu"] },
+ { "filename": "holidays/locale/ru_RU/LC_MESSAGES/*.po", "dictionaries": ["ru-ru"] },
+ { "filename": "holidays/locale/uk_UA/LC_MESSAGES/*.po", "dictionaries": ["uk-ua"] },
+ { "filename": "holidays/locale/tr_TR/LC_MESSAGES/*.po", "dictionaries": ["tr-tr"] },
+ { "filename": "holidays/locale/el_GR/LC_MESSAGES/*.po", "dictionaries": ["el"] },
+ { "filename": "holidays/locale/he_IL/LC_MESSAGES/*.po", "dictionaries": ["he"] },
+ { "filename": "holidays/locale/ar_*/LC_MESSAGES/*.po", "dictionaries": ["ar"] },
+ { "filename": "holidays/locale/hi_IN/LC_MESSAGES/*.po", "dictionaries": ["hi"] },
+ { "filename": "holidays/locale/id_ID/LC_MESSAGES/*.po", "dictionaries": ["id-id"] },
+ { "filename": "holidays/locale/vi_VN/LC_MESSAGES/*.po", "dictionaries": ["vi-vn"] },
+ { "filename": "holidays/locale/ga_IE/LC_MESSAGES/*.po", "dictionaries": ["gd"] },
+ { "filename": "holidays/locale/la_LA/LC_MESSAGES/*.po", "dictionaries": ["la"] }
+ ],If helpful, I can generate the full overrides list based on the actual locales present.
📝 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.
| ], | |
| "dictionaries": [ | |
| "ar", | |
| "bg-bg", | |
| "bn", | |
| "ca", | |
| "companies", | |
| "cs-cz", | |
| "da-dk", | |
| "de-at", | |
| "de-ch", | |
| "de-de", | |
| "el", | |
| "en_us", | |
| "en-au", | |
| "en-ca", | |
| "en-common-misspellings", | |
| "en-gb", | |
| "eo", | |
| "es-es", | |
| "et-ee", | |
| "eu", | |
| "fa-ir", | |
| "fi-fi", | |
| "fr-fr", | |
| "gd", | |
| "gl-es", | |
| "grc", | |
| "he", | |
| "hr-hr", | |
| "hu-hu", | |
| "hy", | |
| "id-id", | |
| "it-it", | |
| "la", | |
| "lt-lt", | |
| "lv", | |
| "makefile", | |
| "markdown", | |
| "mk", | |
| "mn-mn", | |
| "nb-no", | |
| "nl-nl", | |
| "pl-pl", | |
| "pt-br", | |
| "pt-pt", | |
| "python", | |
| "ro-ro", | |
| "ru-ru", | |
| "scientific-terms-gb", | |
| "sk-sk", | |
| "sl-si", | |
| "sr-cyrl", | |
| "sr-latn", | |
| "sv", | |
| "software-terms", | |
| "tr-tr", | |
| "uk-ua", | |
| "vi-vn", | |
| "custom-dict" | |
| ], | |
| ], | |
| "dictionaries": [ | |
| "ar", | |
| "bg-bg", | |
| "bn", | |
| "ca", | |
| "companies", | |
| "cs-cz", | |
| "da-dk", | |
| "de-at", | |
| "de-ch", | |
| "de-de", | |
| "el", | |
| "en_us", | |
| "en-au", | |
| "en-ca", | |
| "en-common-misspellings", | |
| "en-gb", | |
| "eo", | |
| "es-es", | |
| "et-ee", | |
| "eu", | |
| "fa-ir", | |
| "fi-fi", | |
| "fr-fr", | |
| "gd", | |
| "gl-es", | |
| "grc", | |
| "he", | |
| "hr-hr", | |
| "hu-hu", | |
| "hy", | |
| "id-id", | |
| "it-it", | |
| "la", | |
| "lt-lt", | |
| "lv", | |
| "makefile", | |
| "markdown", | |
| "mk", | |
| "mn-mn", | |
| "nb-no", | |
| "nl-nl", | |
| "pl-pl", | |
| "pt-br", | |
| "pt-pt", | |
| "python", | |
| "ro-ro", | |
| "ru-ru", | |
| "scientific-terms-gb", | |
| "sk-sk", | |
| "sl-si", | |
| "sr-cyrl", | |
| "sr-latn", | |
| "sv", | |
| "software-terms", | |
| "tr-tr", | |
| "uk-ua", | |
| "vi-vn", | |
| "custom-dict" | |
| ], | |
| "overrides": [ | |
| { "filename": "holidays/locale/de_DE/LC_MESSAGES/*.po", "dictionaries": ["de-de"], "allowCompoundWords": true }, | |
| { "filename": "holidays/locale/de_AT/LC_MESSAGES/*.po", "dictionaries": ["de-at"], "allowCompoundWords": true }, | |
| { "filename": "holidays/locale/de_CH/LC_MESSAGES/*.po", "dictionaries": ["de-ch"], "allowCompoundWords": true }, | |
| { "filename": "holidays/locale/fr_FR/LC_MESSAGES/*.po", "dictionaries": ["fr-fr"] }, | |
| { "filename": "holidays/locale/es_ES/LC_MESSAGES/*.po", "dictionaries": ["es-es"] }, | |
| { "filename": "holidays/locale/pt_PT/LC_MESSAGES/*.po", "dictionaries": ["pt-pt"] }, | |
| { "filename": "holidays/locale/pt_BR/LC_MESSAGES/*.po", "dictionaries": ["pt-br"] }, | |
| { "filename": "holidays/locale/it_IT/LC_MESSAGES/*.po", "dictionaries": ["it-it"] }, | |
| { "filename": "holidays/locale/nl_NL/LC_MESSAGES/*.po", "dictionaries": ["nl-nl"] }, | |
| { "filename": "holidays/locale/sv_SE/LC_MESSAGES/*.po", "dictionaries": ["sv"], "allowCompoundWords": true }, | |
| { "filename": "holidays/locale/nb_NO/LC_MESSAGES/*.po", "dictionaries": ["nb-no"] }, | |
| { "filename": "holidays/locale/fi_FI/LC_MESSAGES/*.po", "dictionaries": ["fi-fi"] }, | |
| { "filename": "holidays/locale/pl_PL/LC_MESSAGES/*.po", "dictionaries": ["pl-pl"] }, | |
| { "filename": "holidays/locale/cs_CZ/LC_MESSAGES/*.po", "dictionaries": ["cs-cz"] }, | |
| { "filename": "holidays/locale/sk_SK/LC_MESSAGES/*.po", "dictionaries": ["sk-sk"] }, | |
| { "filename": "holidays/locale/sl_SI/LC_MESSAGES/*.po", "dictionaries": ["sl-si"] }, | |
| { "filename": "holidays/locale/ro_RO/LC_MESSAGES/*.po", "dictionaries": ["ro-ro"] }, | |
| { "filename": "holidays/locale/hu_HU/LC_MESSAGES/*.po", "dictionaries": ["hu-hu"] }, | |
| { "filename": "holidays/locale/ru_RU/LC_MESSAGES/*.po", "dictionaries": ["ru-ru"] }, | |
| { "filename": "holidays/locale/uk_UA/LC_MESSAGES/*.po", "dictionaries": ["uk-ua"] }, | |
| { "filename": "holidays/locale/tr_TR/LC_MESSAGES/*.po", "dictionaries": ["tr-tr"] }, | |
| { "filename": "holidays/locale/el_GR/LC_MESSAGES/*.po", "dictionaries": ["el"] }, | |
| { "filename": "holidays/locale/he_IL/LC_MESSAGES/*.po", "dictionaries": ["he"] }, | |
| { "filename": "holidays/locale/ar_*/LC_MESSAGES/*.po", "dictionaries": ["ar"] }, | |
| { "filename": "holidays/locale/hi_IN/LC_MESSAGES/*.po", "dictionaries": ["hi"] }, | |
| { "filename": "holidays/locale/id_ID/LC_MESSAGES/*.po", "dictionaries": ["id-id"] }, | |
| { "filename": "holidays/locale/vi_VN/LC_MESSAGES/*.po", "dictionaries": ["vi-vn"] }, | |
| { "filename": "holidays/locale/ga_IE/LC_MESSAGES/*.po", "dictionaries": ["gd"] }, | |
| { "filename": "holidays/locale/la_LA/LC_MESSAGES/*.po", "dictionaries": ["la"] } | |
| ], |
🤖 Prompt for AI Agents
In cspell/cspell.json around lines 12 to 72, the project-wide dictionary list is
too broad and creates 25k+ unknowns; add per-locale overrides that map each repo
locale folder (e.g., locales/de, locales/sv, etc.) to the matching
locale-specific dictionary (de-de, sv, etc.) and enable "allowCompoundWords":
true for compound-heavy languages (e.g., de-de, sv) so their valid compounds
aren’t flagged; update the "overrides" array with globs for each locale
directory pointing to the corresponding dictionary and set "dictionaries" and
"allowCompoundWords" as needed for those overrides, keeping custom-dict minimal.
| "files": [ | ||
| "docs/**/*", | ||
| "README.md", | ||
| "scripts/l10n/**/*", | ||
| "mkdocs.yml" | ||
| ], |
There was a problem hiding this comment.
🛠️ Refactor suggestion
Include .po files to meet the “l10n coverage” objective (scoped).
Currently only docs and scripts are scanned; locale .po files aren’t. Add targeted globs for PO files.
Apply:
"files": [
"docs/**/*",
"README.md",
- "scripts/l10n/**/*",
- "mkdocs.yml"
+ "scripts/l10n/**/*",
+ "mkdocs.yml",
+ "holidays/**/LC_MESSAGES/*.po"
],📝 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.
| "files": [ | |
| "docs/**/*", | |
| "README.md", | |
| "scripts/l10n/**/*", | |
| "mkdocs.yml" | |
| ], | |
| "files": [ | |
| "docs/**/*", | |
| "README.md", | |
| "scripts/l10n/**/*", | |
| "mkdocs.yml", | |
| "holidays/**/LC_MESSAGES/*.po" | |
| ], |
🤖 Prompt for AI Agents
In cspell/cspell.json around lines 74 to 79, the "files" array doesn’t include
locale .po files so the l10n coverage objective isn't met; update the array to
add targeted globs that include PO files used by the project (for example add
entries matching common locations such as locale/**/*.po, po/**/*.po, and
i18n/**/*.po) so spellcheck scans translation files while keeping existing
doc/script globs.
| :cspell-install | ||
| where docker >nul 2>nul | ||
| if %errorlevel% neq 0 ( | ||
| echo ERROR: docker not found in PATH. Install Docker Desktop or add docker.exe to PATH. | ||
| goto end | ||
| ) | ||
| set "build_args=" | ||
| if defined FORCE set "build_args=--no-cache" | ||
| set "DOCKER_BUILDKIT=true" && docker build %build_args% -f cspell/Dockerfile -t cspell cspell | ||
| goto end |
There was a problem hiding this comment.
🧹 Nitpick (assertive)
Docker check and build flow look good; minor nit: quote build context.
Apply:
-set "DOCKER_BUILDKIT=true" && docker build %build_args% -f cspell/Dockerfile -t cspell cspell
+set "DOCKER_BUILDKIT=true" && docker build %build_args% -f cspell/Dockerfile -t cspell "cspell"📝 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.
| :cspell-install | |
| where docker >nul 2>nul | |
| if %errorlevel% neq 0 ( | |
| echo ERROR: docker not found in PATH. Install Docker Desktop or add docker.exe to PATH. | |
| goto end | |
| ) | |
| set "build_args=" | |
| if defined FORCE set "build_args=--no-cache" | |
| set "DOCKER_BUILDKIT=true" && docker build %build_args% -f cspell/Dockerfile -t cspell cspell | |
| goto end | |
| :cspell-install | |
| where docker >nul 2>nul | |
| if %errorlevel% neq 0 ( | |
| echo ERROR: docker not found in PATH. Install Docker Desktop or add docker.exe to PATH. | |
| goto end | |
| ) | |
| set "build_args=" | |
| if defined FORCE set "build_args=--no-cache" | |
| set "DOCKER_BUILDKIT=true" && docker build %build_args% -f cspell/Dockerfile -t cspell "cspell" | |
| goto end |
🤖 Prompt for AI Agents
In cspell/make.cmd around lines 18 to 27, the docker build command passes the
build context unquoted which can break when the path contains spaces; update the
command to quote the build context (e.g., change the trailing cspell to
"cspell") so the context is treated as a single argument; keep the rest of the
line intact and ensure the quoted context is used with the existing build args
and options.
| :cspell-check | ||
| set CMD=--no-progress -r /holidays | ||
| call :cspell-install | ||
| call :cspell-run | ||
| docker run --mount type=bind,src="%CD%",dst=/holidays,readonly --rm cspell lint -c cspell/cspell.json %CMD% | ||
| goto end |
There was a problem hiding this comment.
🧹 Nitpick (assertive)
Read-only bind is good; also quote config path (Windows-safe).
Apply:
-docker run --mount type=bind,src="%CD%",dst=/holidays,readonly --rm cspell lint -c cspell/cspell.json %CMD%
+docker run --mount type=bind,src="%CD%",dst=/holidays,readonly --rm cspell lint -c "cspell/cspell.json" %CMD%📝 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.
| :cspell-check | |
| set CMD=--no-progress -r /holidays | |
| call :cspell-install | |
| call :cspell-run | |
| docker run --mount type=bind,src="%CD%",dst=/holidays,readonly --rm cspell lint -c cspell/cspell.json %CMD% | |
| goto end | |
| :cspell-check | |
| set CMD=--no-progress -r /holidays | |
| call :cspell-install | |
| call :cspell-run | |
| docker run --mount type=bind,src="%CD%",dst=/holidays,readonly --rm cspell lint -c "cspell/cspell.json" %CMD% | |
| goto end |
🤖 Prompt for AI Agents
In cspell/make.cmd around lines 37 to 42, keep the read-only bind mount but make
the cspell config path Windows-safe by quoting the -c argument; update the
docker run command to pass -c "cspell/cspell.json" (retain the existing --mount
... readonly and other flags) so the config path is treated as a single token on
Windows shells.
| "@cspell/dict-ar": "^1.1.6", | ||
| "@cspell/dict-bg-bg": "^3.0.8", | ||
| "@cspell/dict-bn": "^1.0.3", | ||
| "@cspell/dict-ca": "^3.1.2", | ||
| "@cspell/dict-companies": "^3.2.5", | ||
| "@cspell/dict-cs-cz": "^3.0.8", | ||
| "@cspell/dict-da-dk": "^4.1.2", | ||
| "@cspell/dict-de-at": "^1.2.2", | ||
| "@cspell/dict-de-ch": "^1.3.2", | ||
| "@cspell/dict-de-de": "^4.1.2", | ||
| "@cspell/dict-el": "^3.1.8", | ||
| "@cspell/dict-en-au": "^1.1.7", | ||
| "@cspell/dict-en-ca": "^1.0.45", | ||
| "@cspell/dict-en-common-misspellings": "^2.1.6", | ||
| "@cspell/dict-en-gb": "^5.0.14", | ||
| "@cspell/dict-en_us": "^4.4.19", | ||
| "@cspell/dict-eo": "^3.0.7", | ||
| "@cspell/dict-es-es": "^3.0.8", | ||
| "@cspell/dict-et-ee": "^3.1.6", | ||
| "@cspell/dict-eu": "^1.0.6", | ||
| "@cspell/dict-fa-ir": "^4.0.5", | ||
| "@cspell/dict-fi-fi": "^1.1.3", | ||
| "@cspell/dict-fr-fr": "^2.3.2", | ||
| "@cspell/dict-gd": "^1.0.3", | ||
| "@cspell/dict-gl-es": "^1.1.3", | ||
| "@cspell/dict-grc": "^1.0.7", | ||
| "@cspell/dict-he": "^4.0.5", | ||
| "@cspell/dict-hr-hr": "^3.1.2", | ||
| "@cspell/dict-hu-hu": "^1.1.2", | ||
| "@cspell/dict-hy": "^1.0.3", | ||
| "@cspell/dict-id-id": "^1.0.7", | ||
| "@cspell/dict-it-it": "^3.1.6", | ||
| "@cspell/dict-la": "^1.1.2", | ||
| "@cspell/dict-lt-lt": "^4.0.6", | ||
| "@cspell/dict-lv": "^1.1.6", | ||
| "@cspell/dict-makefile": "^1.0.5", | ||
| "@cspell/dict-markdown": "^2.0.12", | ||
| "@cspell/dict-mk": "^1.0.3", | ||
| "@cspell/dict-mn-mn": "^1.2.2", | ||
| "@cspell/dict-nb-no": "^2.0.6", | ||
| "@cspell/dict-nl-nl": "^2.4.2", | ||
| "@cspell/dict-pt-br": "^2.4.2", | ||
| "@cspell/dict-pt-pt": "^3.0.6", | ||
| "@cspell/dict-python": "^4.2.19", | ||
| "@cspell/dict-ro-ro": "^2.0.6", | ||
| "@cspell/dict-scientific-terms-gb": "^1.0.6", | ||
| "@cspell/dict-sk-sk": "^1.1.7", | ||
| "@cspell/dict-sl-si": "^1.0.11", | ||
| "@cspell/dict-software-terms": "^5.1.8", | ||
| "@cspell/dict-sr-cyrl": "^1.1.6", | ||
| "@cspell/dict-sr-latn": "^1.0.8", | ||
| "@cspell/dict-sv": "^2.3.2", | ||
| "@cspell/dict-tr-tr": "^3.0.6", | ||
| "@cspell/dict-uk-ua": "^4.0.6", | ||
| "@cspell/dict-vi-vn": "^3.0.6", | ||
| "cspell": "^8.19.4" |
There was a problem hiding this comment.
🧹 Nitpick (assertive)
Scope dictionaries per path to cut false positives and speed up.
Load only the relevant language dictionaries for each l10n directory via cspell.json languageSettings (e.g., map holidays/locale/pt*/ to pt-pt/pt-br dicts, etc.) instead of enabling all dicts globally.
| def sort_custom_dict(): | ||
| dict_file = Path(__file__).parent.parent / "cspell" / "custom-dict.txt" | ||
| if not dict_file.exists(): | ||
| print(f"Dictionary file {dict_file} not found.") | ||
| return | ||
|
|
||
| with open(dict_file, 'r', encoding='utf-8') as f: | ||
| words = f.read().splitlines() | ||
|
|
||
| # Remove duplicates while preserving order (case-sensitive) | ||
| seen = set() | ||
| unique_words = [] | ||
| for word in words: | ||
| if word not in seen: | ||
| seen.add(word) | ||
| unique_words.append(word) | ||
|
|
||
| # Sort the words | ||
| unique_words.sort() | ||
|
|
||
| with open(dict_file, 'w', encoding='utf-8') as f: | ||
| f.write('\n'.join(unique_words) + '\n') | ||
|
|
||
| print(f"Sorted and uniquified {dict_file}") | ||
|
|
There was a problem hiding this comment.
Preserve comments, drop blanks, and dedupe/sort case-insensitively.
Current logic sorts and dedupes comments with words, keeps blanks, and dedupes case-sensitively despite caseSensitive=false in cspell.json.
Apply:
def sort_custom_dict():
dict_file = Path(__file__).parent.parent / "cspell" / "custom-dict.txt"
if not dict_file.exists():
print(f"Dictionary file {dict_file} not found.")
return
- with open(dict_file, 'r', encoding='utf-8') as f:
- words = f.read().splitlines()
+ with open(dict_file, 'r', encoding='utf-8') as f:
+ lines = f.read().splitlines()
- # Remove duplicates while preserving order (case-sensitive)
- seen = set()
- unique_words = []
- for word in words:
- if word not in seen:
- seen.add(word)
- unique_words.append(word)
+ # Separate comments and words; strip whitespace; drop blanks
+ comments: list[str] = []
+ words: list[str] = []
+ for raw in lines:
+ line = raw.rstrip()
+ if not line:
+ continue
+ if line.lstrip().startswith("#"):
+ comments.append(line)
+ else:
+ words.append(line.strip())
- # Sort the words
- unique_words.sort()
+ # Dedupe case-insensitively (cspell config is case-insensitive) while preserving first-seen casing
+ seen_ci: set[str] = set()
+ unique_words: list[str] = []
+ for w in words:
+ key = w.casefold()
+ if key not in seen_ci:
+ seen_ci.add(key)
+ unique_words.append(w)
+
+ # Sort words case-insensitively but keep original casing
+ unique_words.sort(key=str.casefold)
with open(dict_file, 'w', encoding='utf-8') as f:
- f.write('\n'.join(unique_words) + '\n')
+ out = []
+ if comments:
+ out.extend(comments)
+ if comments and unique_words:
+ out.append("") # spacer
+ out.extend(unique_words)
+ f.write('\n'.join(out) + '\n')
- print(f"Sorted and uniquified {dict_file}")
+ print(f"Sorted and uniquified {dict_file}")📝 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.
| def sort_custom_dict(): | |
| dict_file = Path(__file__).parent.parent / "cspell" / "custom-dict.txt" | |
| if not dict_file.exists(): | |
| print(f"Dictionary file {dict_file} not found.") | |
| return | |
| with open(dict_file, 'r', encoding='utf-8') as f: | |
| words = f.read().splitlines() | |
| # Remove duplicates while preserving order (case-sensitive) | |
| seen = set() | |
| unique_words = [] | |
| for word in words: | |
| if word not in seen: | |
| seen.add(word) | |
| unique_words.append(word) | |
| # Sort the words | |
| unique_words.sort() | |
| with open(dict_file, 'w', encoding='utf-8') as f: | |
| f.write('\n'.join(unique_words) + '\n') | |
| print(f"Sorted and uniquified {dict_file}") | |
| def sort_custom_dict(): | |
| dict_file = Path(__file__).parent.parent / "cspell" / "custom-dict.txt" | |
| if not dict_file.exists(): | |
| print(f"Dictionary file {dict_file} not found.") | |
| return | |
| with open(dict_file, 'r', encoding='utf-8') as f: | |
| lines = f.read().splitlines() | |
| # Separate comments and words; strip whitespace; drop blanks | |
| comments: list[str] = [] | |
| words: list[str] = [] | |
| for raw in lines: | |
| line = raw.rstrip() | |
| if not line: | |
| continue | |
| if line.lstrip().startswith("#"): | |
| comments.append(line) | |
| else: | |
| words.append(line.strip()) | |
| # Dedupe case-insensitively (cspell config is case-insensitive) while preserving first-seen casing | |
| seen_ci: set[str] = set() | |
| unique_words: list[str] = [] | |
| for w in words: | |
| key = w.casefold() | |
| if key not in seen_ci: | |
| seen_ci.add(key) | |
| unique_words.append(w) | |
| # Sort words case-insensitively but keep original casing | |
| unique_words.sort(key=str.casefold) | |
| with open(dict_file, 'w', encoding='utf-8') as f: | |
| out = [] | |
| if comments: | |
| out.extend(comments) | |
| if comments and unique_words: | |
| out.append("") # spacer | |
| out.extend(unique_words) | |
| f.write('\n'.join(out) + '\n') | |
| print(f"Sorted and uniquified {dict_file}") |
|
|
Closed as abandoned. :( |
|
Hi! I noticed this was closed as abandoned, but I've actually been waiting for a review. I'm still very interested in getting this merged—could we reopen this, or should I open a fresh PR? |
Signed-off-by: Prateekshit Jaiswal <67361301+Prateekshit73@users.noreply.github.com>
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@Makefile`:
- Around line 31-32: The sort-custom-dict Makefile target should fail fast when
the custom dictionary is missing: update the sort-custom-dict target (which
currently just runs tools/sort_cspell_dict.py) to first check that
cspell/custom-dict.txt exists and exit non-zero with a clear error if it does
not (e.g., test -f cspell/custom-dict.txt || { echo "..."; exit 1; }), or
alternatively make tools/sort_cspell_dict.py return a non-zero status when the
file is absent so the Make target fails; reference the sort-custom-dict target,
tools/sort_cspell_dict.py, and cspell/custom-dict.txt when implementing the
change.
🪄 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: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 1ee65127-9695-4012-9ca6-006b953e09e2
📒 Files selected for processing (2)
.pre-commit-config.yamlMakefile
…cspell scripts - Updated usage descriptions in `make.cmd` and `Makefile` to clarify that spellcheck runs on docs and l10n only. - Improved error handling in `cspell/make.cmd` to notify users of Docker build failures. - Adjusted `cspell/Makefile` to streamline the spellcheck process. - Added new entries to `cspell/custom-dict.txt` for additional project-specific terms. - Enhanced `sort_cspell_dict.py` with better error handling and output messages.
There was a problem hiding this comment.
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)
Makefile (1)
3-3: 🧹 Nitpick | 🔵 TrivialDeclare new targets as PHONY.
spellcheckandsort-custom-dictshould be listed to prevent conflicts with potential filenames.Expand PHONY declaration
-.PHONY: help +.PHONY: help spellcheck sort-custom-dict🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@Makefile` at line 3, The .PHONY declaration only lists help; update the PHONY line to include the new targets to avoid filename conflicts by adding spellcheck and sort-custom-dict to the list (i.e., make .PHONY include help, spellcheck, sort-custom-dict). Locate the .PHONY declaration in the Makefile and append those target names separated by spaces.
♻️ Duplicate comments (1)
cspell/make.cmd (1)
41-47:⚠️ Potential issue | 🟡 MinorError code propagation incomplete.
Line 44 goes to
:endon failure, but:endjust ends the script without setting exit code. The failure gets swallowed.Propagate exit code properly
:cspell-check set CMD=--no-progress -r /holidays call :cspell-install -if %errorlevel% neq 0 goto end +if %errorlevel% neq 0 exit /b %errorlevel% call :cspell-run -docker run --mount type=bind,src="%CD%",dst=/holidays,readonly --rm cspell lint -c cspell/cspell.json %CMD% +docker run --mount type=bind,src="%CD%",dst=/holidays,readonly --rm cspell lint -c "cspell/cspell.json" %CMD% +exit /b %errorlevel% -goto end🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@cspell/make.cmd` around lines 41 - 47, The script currently jumps to :end on failures (e.g., after calling :cspell-install) but :end merely exits the script without preserving the ERRORLEVEL, swallowing failures; update the end-of-script behavior so the process returns the proper exit code — either capture %ERRORLEVEL% before jumping to :end and use exit /b %ERRORLEVEL% there, or change :end to explicitly run exit /b %ERRORLEVEL% (affecting labels :cspell-check, :cspell-install, :cspell-run and the final docker run invocation) so failures propagate to the caller.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@cspell/make.cmd`:
- Around line 33-35: Remove the no-op cspell-run placeholder label and its goto
in the make.cmd file and delete any references to cspell-run elsewhere
(dispatch, help text, and cspell-check) so there is no empty target left;
specifically remove the ":cspell-run" label block and any "goto cspell-run" or
mentions of "cspell-run" and ensure cspell-check continues to invoke the Docker
run inline as in the Unix Makefile.
In `@cspell/package.json`:
- Around line 10-66: The cspell config references "pl-pl" and "ru-ru"
dictionaries but package.json devDependencies (the "devDependencies" block) is
missing `@cspell/dict-pl-pl` and `@cspell/dict-ru-ru`; add "@cspell/dict-pl-pl" and
"@cspell/dict-ru-ru" with appropriate versions to the devDependencies so CSpell
can load those dictionaries at runtime (update the same devDependencies object
shown in the diff).
---
Outside diff comments:
In `@Makefile`:
- Line 3: The .PHONY declaration only lists help; update the PHONY line to
include the new targets to avoid filename conflicts by adding spellcheck and
sort-custom-dict to the list (i.e., make .PHONY include help, spellcheck,
sort-custom-dict). Locate the .PHONY declaration in the Makefile and append
those target names separated by spaces.
---
Duplicate comments:
In `@cspell/make.cmd`:
- Around line 41-47: The script currently jumps to :end on failures (e.g., after
calling :cspell-install) but :end merely exits the script without preserving the
ERRORLEVEL, swallowing failures; update the end-of-script behavior so the
process returns the proper exit code — either capture %ERRORLEVEL% before
jumping to :end and use exit /b %ERRORLEVEL% there, or change :end to explicitly
run exit /b %ERRORLEVEL% (affecting labels :cspell-check, :cspell-install,
:cspell-run and the final docker run invocation) so failures propagate to the
caller.
🪄 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: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: f0a01cbd-0302-4052-92a8-a35c06adc353
📒 Files selected for processing (7)
Makefilecspell/Makefilecspell/custom-dict.txtcspell/make.cmdcspell/package.jsonmake.cmdtools/sort_cspell_dict.py
| :cspell-run | ||
| rem Placeholder for cspell-run | ||
| goto end |
There was a problem hiding this comment.
🧹 Nitpick | 🔵 Trivial
Remove unused cspell-run placeholder.
This does nothing and adds confusion. The Unix Makefile doesn't have a separate cspell-run target either - the docker run is inline in cspell-check.
Remove placeholder and its references
-:cspell-run
-rem Placeholder for cspell-run
-goto end
-And in dispatch:
-if "%TARGET%"=="cspell-run" goto cspell-runAnd in help:
-echo cspell-run run cspell (placeholder)And in cspell-check:
-call :cspell-run🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@cspell/make.cmd` around lines 33 - 35, Remove the no-op cspell-run
placeholder label and its goto in the make.cmd file and delete any references to
cspell-run elsewhere (dispatch, help text, and cspell-check) so there is no
empty target left; specifically remove the ":cspell-run" label block and any
"goto cspell-run" or mentions of "cspell-run" and ensure cspell-check continues
to invoke the Docker run inline as in the Unix Makefile.
| "devDependencies": { | ||
| "@cspell/dict-ar": "^1.1.6", | ||
| "@cspell/dict-bg-bg": "^3.0.8", | ||
| "@cspell/dict-bn": "^1.0.3", | ||
| "@cspell/dict-ca": "^3.1.2", | ||
| "@cspell/dict-companies": "^3.2.5", | ||
| "@cspell/dict-cs-cz": "^3.0.8", | ||
| "@cspell/dict-da-dk": "^4.1.2", | ||
| "@cspell/dict-de-at": "^1.2.2", | ||
| "@cspell/dict-de-ch": "^1.3.2", | ||
| "@cspell/dict-de-de": "^4.1.2", | ||
| "@cspell/dict-el": "^3.1.8", | ||
| "@cspell/dict-en-au": "^1.1.7", | ||
| "@cspell/dict-en-ca": "^1.0.45", | ||
| "@cspell/dict-en-common-misspellings": "^2.1.6", | ||
| "@cspell/dict-en-gb": "^5.0.14", | ||
| "@cspell/dict-en_us": "^4.4.19", | ||
| "@cspell/dict-eo": "^3.0.7", | ||
| "@cspell/dict-es-es": "^3.0.8", | ||
| "@cspell/dict-et-ee": "^3.1.6", | ||
| "@cspell/dict-eu": "^1.0.6", | ||
| "@cspell/dict-fa-ir": "^4.0.5", | ||
| "@cspell/dict-fi-fi": "^1.1.3", | ||
| "@cspell/dict-fr-fr": "^2.3.2", | ||
| "@cspell/dict-gd": "^1.0.3", | ||
| "@cspell/dict-gl-es": "^1.1.3", | ||
| "@cspell/dict-grc": "^1.0.7", | ||
| "@cspell/dict-he": "^4.0.5", | ||
| "@cspell/dict-hr-hr": "^3.1.2", | ||
| "@cspell/dict-hu-hu": "^1.1.2", | ||
| "@cspell/dict-hy": "^1.0.3", | ||
| "@cspell/dict-id-id": "^1.0.7", | ||
| "@cspell/dict-it-it": "^3.1.6", | ||
| "@cspell/dict-la": "^1.1.2", | ||
| "@cspell/dict-lt-lt": "^4.0.6", | ||
| "@cspell/dict-lv": "^1.1.6", | ||
| "@cspell/dict-makefile": "^1.0.5", | ||
| "@cspell/dict-markdown": "^2.0.12", | ||
| "@cspell/dict-mk": "^1.0.3", | ||
| "@cspell/dict-mn-mn": "^1.2.2", | ||
| "@cspell/dict-nb-no": "^2.0.6", | ||
| "@cspell/dict-nl-nl": "^2.4.2", | ||
| "@cspell/dict-pt-br": "^2.4.2", | ||
| "@cspell/dict-pt-pt": "^3.0.6", | ||
| "@cspell/dict-python": "^4.2.19", | ||
| "@cspell/dict-ro-ro": "^2.0.6", | ||
| "@cspell/dict-scientific-terms-gb": "^1.0.6", | ||
| "@cspell/dict-sk-sk": "^1.1.7", | ||
| "@cspell/dict-sl-si": "^1.0.11", | ||
| "@cspell/dict-software-terms": "^5.1.8", | ||
| "@cspell/dict-sr-cyrl": "^1.1.6", | ||
| "@cspell/dict-sr-latn": "^1.0.8", | ||
| "@cspell/dict-sv": "^2.3.2", | ||
| "@cspell/dict-tr-tr": "^3.0.6", | ||
| "@cspell/dict-uk-ua": "^4.0.6", | ||
| "@cspell/dict-vi-vn": "^3.0.6", | ||
| "cspell": "^8.19.4" |
There was a problem hiding this comment.
🧩 Analysis chain
🌐 Web query:
What are the latest versions of @cspell/dict-pl-pland@cspell/dict-ru-ru npm packages?
💡 Result:
The latest version of @cspell/dict-pl-pl is 3.0.6. The latest version of @cspell/dict-ru-ru is 2.3.2.
Citations:
- 1: https://www.npmjs.com/package/@cspell/dict-pl_pl
- 2: https://www.npmjs.com/package/@cspell/dict-ru_ru
- 3: https://jsdelivr.com/package/npm/%40cspell/dict-ru_ru
- 4: https://github.com/streetsidesoftware/cspell-dicts
🏁 Script executed:
# Check if cspell.json exists and search for dictionary references
find . -name "cspell.json" -type f | head -5Repository: vacanza/holidays
Length of output: 80
🏁 Script executed:
# Look for the pl-pl and ru-ru dictionaries in the provided package.json snippet
grep -E "(pl-pl|ru-ru)" cspell/package.json || echo "Not found in package.json"Repository: vacanza/holidays
Length of output: 85
🏁 Script executed:
# Read the cspell.json to verify dictionary references
cat ./cspell/cspell.jsonRepository: vacanza/holidays
Length of output: 1755
Add missing dictionary packages to devDependencies.
cspell.json references "pl-pl" and "ru-ru" in the dictionaries array, but @cspell/dict-pl-pl and @cspell/dict-ru-ru aren't declared in devDependencies. CSpell will fail to load these dictionaries at runtime.
Add missing dictionary packages
"@cspell/dict-nl-nl": "^2.4.2",
+ "@cspell/dict-pl-pl": "^3.0.6",
"@cspell/dict-pt-br": "^2.4.2",
"@cspell/dict-pt-pt": "^3.0.6",
"@cspell/dict-python": "^4.2.19",
"@cspell/dict-ro-ro": "^2.0.6",
+ "@cspell/dict-ru-ru": "^2.3.2",
"@cspell/dict-scientific-terms-gb": "^1.0.6",📝 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.
| "devDependencies": { | |
| "@cspell/dict-ar": "^1.1.6", | |
| "@cspell/dict-bg-bg": "^3.0.8", | |
| "@cspell/dict-bn": "^1.0.3", | |
| "@cspell/dict-ca": "^3.1.2", | |
| "@cspell/dict-companies": "^3.2.5", | |
| "@cspell/dict-cs-cz": "^3.0.8", | |
| "@cspell/dict-da-dk": "^4.1.2", | |
| "@cspell/dict-de-at": "^1.2.2", | |
| "@cspell/dict-de-ch": "^1.3.2", | |
| "@cspell/dict-de-de": "^4.1.2", | |
| "@cspell/dict-el": "^3.1.8", | |
| "@cspell/dict-en-au": "^1.1.7", | |
| "@cspell/dict-en-ca": "^1.0.45", | |
| "@cspell/dict-en-common-misspellings": "^2.1.6", | |
| "@cspell/dict-en-gb": "^5.0.14", | |
| "@cspell/dict-en_us": "^4.4.19", | |
| "@cspell/dict-eo": "^3.0.7", | |
| "@cspell/dict-es-es": "^3.0.8", | |
| "@cspell/dict-et-ee": "^3.1.6", | |
| "@cspell/dict-eu": "^1.0.6", | |
| "@cspell/dict-fa-ir": "^4.0.5", | |
| "@cspell/dict-fi-fi": "^1.1.3", | |
| "@cspell/dict-fr-fr": "^2.3.2", | |
| "@cspell/dict-gd": "^1.0.3", | |
| "@cspell/dict-gl-es": "^1.1.3", | |
| "@cspell/dict-grc": "^1.0.7", | |
| "@cspell/dict-he": "^4.0.5", | |
| "@cspell/dict-hr-hr": "^3.1.2", | |
| "@cspell/dict-hu-hu": "^1.1.2", | |
| "@cspell/dict-hy": "^1.0.3", | |
| "@cspell/dict-id-id": "^1.0.7", | |
| "@cspell/dict-it-it": "^3.1.6", | |
| "@cspell/dict-la": "^1.1.2", | |
| "@cspell/dict-lt-lt": "^4.0.6", | |
| "@cspell/dict-lv": "^1.1.6", | |
| "@cspell/dict-makefile": "^1.0.5", | |
| "@cspell/dict-markdown": "^2.0.12", | |
| "@cspell/dict-mk": "^1.0.3", | |
| "@cspell/dict-mn-mn": "^1.2.2", | |
| "@cspell/dict-nb-no": "^2.0.6", | |
| "@cspell/dict-nl-nl": "^2.4.2", | |
| "@cspell/dict-pt-br": "^2.4.2", | |
| "@cspell/dict-pt-pt": "^3.0.6", | |
| "@cspell/dict-python": "^4.2.19", | |
| "@cspell/dict-ro-ro": "^2.0.6", | |
| "@cspell/dict-scientific-terms-gb": "^1.0.6", | |
| "@cspell/dict-sk-sk": "^1.1.7", | |
| "@cspell/dict-sl-si": "^1.0.11", | |
| "@cspell/dict-software-terms": "^5.1.8", | |
| "@cspell/dict-sr-cyrl": "^1.1.6", | |
| "@cspell/dict-sr-latn": "^1.0.8", | |
| "@cspell/dict-sv": "^2.3.2", | |
| "@cspell/dict-tr-tr": "^3.0.6", | |
| "@cspell/dict-uk-ua": "^4.0.6", | |
| "@cspell/dict-vi-vn": "^3.0.6", | |
| "cspell": "^8.19.4" | |
| "devDependencies": { | |
| "@cspell/dict-ar": "^1.1.6", | |
| "@cspell/dict-bg-bg": "^3.0.8", | |
| "@cspell/dict-bn": "^1.0.3", | |
| "@cspell/dict-ca": "^3.1.2", | |
| "@cspell/dict-companies": "^3.2.5", | |
| "@cspell/dict-cs-cz": "^3.0.8", | |
| "@cspell/dict-da-dk": "^4.1.2", | |
| "@cspell/dict-de-at": "^1.2.2", | |
| "@cspell/dict-de-ch": "^1.3.2", | |
| "@cspell/dict-de-de": "^4.1.2", | |
| "@cspell/dict-el": "^3.1.8", | |
| "@cspell/dict-en-au": "^1.1.7", | |
| "@cspell/dict-en-ca": "^1.0.45", | |
| "@cspell/dict-en-common-misspellings": "^2.1.6", | |
| "@cspell/dict-en-gb": "^5.0.14", | |
| "@cspell/dict-en_us": "^4.4.19", | |
| "@cspell/dict-eo": "^3.0.7", | |
| "@cspell/dict-es-es": "^3.0.8", | |
| "@cspell/dict-et-ee": "^3.1.6", | |
| "@cspell/dict-eu": "^1.0.6", | |
| "@cspell/dict-fa-ir": "^4.0.5", | |
| "@cspell/dict-fi-fi": "^1.1.3", | |
| "@cspell/dict-fr-fr": "^2.3.2", | |
| "@cspell/dict-gd": "^1.0.3", | |
| "@cspell/dict-gl-es": "^1.1.3", | |
| "@cspell/dict-grc": "^1.0.7", | |
| "@cspell/dict-he": "^4.0.5", | |
| "@cspell/dict-hr-hr": "^3.1.2", | |
| "@cspell/dict-hu-hu": "^1.1.2", | |
| "@cspell/dict-hy": "^1.0.3", | |
| "@cspell/dict-id-id": "^1.0.7", | |
| "@cspell/dict-it-it": "^3.1.6", | |
| "@cspell/dict-la": "^1.1.2", | |
| "@cspell/dict-lt-lt": "^4.0.6", | |
| "@cspell/dict-lv": "^1.1.6", | |
| "@cspell/dict-makefile": "^1.0.5", | |
| "@cspell/dict-markdown": "^2.0.12", | |
| "@cspell/dict-mk": "^1.0.3", | |
| "@cspell/dict-mn-mn": "^1.2.2", | |
| "@cspell/dict-nb-no": "^2.0.6", | |
| "@cspell/dict-nl-nl": "^2.4.2", | |
| "@cspell/dict-pl-pl": "^3.0.6", | |
| "@cspell/dict-pt-br": "^2.4.2", | |
| "@cspell/dict-pt-pt": "^3.0.6", | |
| "@cspell/dict-python": "^4.2.19", | |
| "@cspell/dict-ro-ro": "^2.0.6", | |
| "@cspell/dict-ru-ru": "^2.3.2", | |
| "@cspell/dict-scientific-terms-gb": "^1.0.6", | |
| "@cspell/dict-sk-sk": "^1.1.7", | |
| "@cspell/dict-sl-si": "^1.0.11", | |
| "@cspell/dict-software-terms": "^5.1.8", | |
| "@cspell/dict-sr-cyrl": "^1.1.6", | |
| "@cspell/dict-sr-latn": "^1.0.8", | |
| "@cspell/dict-sv": "^2.3.2", | |
| "@cspell/dict-tr-tr": "^3.0.6", | |
| "@cspell/dict-uk-ua": "^4.0.6", | |
| "@cspell/dict-vi-vn": "^3.0.6", | |
| "cspell": "^8.19.4" |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@cspell/package.json` around lines 10 - 66, The cspell config references
"pl-pl" and "ru-ru" dictionaries but package.json devDependencies (the
"devDependencies" block) is missing `@cspell/dict-pl-pl` and `@cspell/dict-ru-ru`;
add "@cspell/dict-pl-pl" and "@cspell/dict-ru-ru" with appropriate versions to
the devDependencies so CSpell can load those dictionaries at runtime (update the
same devDependencies object shown in the diff).
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #2898 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 313 313
Lines 18711 18711
Branches 2393 2393
=========================================
Hits 18711 18711 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Actionable comments posted: 1
♻️ Duplicate comments (4)
make.cmd (1)
25-28: 🧹 Nitpick | 🔵 Trivial | 💤 Low valueMake the path to cspell\make.cmd safe for spaces/symlinks.
Using
%~dp0anchors the path to the script's directory.🔧 Proposed fix
:Spellcheck call :Sort-custom-dict - call cspell\make.cmd cspell-check + call "%~dp0cspell\make.cmd" cspell-check Exit /B %ERRORLEVEL%🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@make.cmd` around lines 25 - 28, The call to launch the cspell make script in the :Spellcheck block uses a hardcoded relative path ("call cspell\make.cmd cspell-check") which can break with spaces or symlinked script locations; change it to use the script directory expansion %~dp0 so the call becomes relative to the current batch file folder (use "%~dp0cspell\make.cmd" when invoking from :Spellcheck) to ensure paths with spaces and symlinks are handled correctly while preserving the existing arguments.cspell/make.cmd (1)
33-35: 🧹 Nitpick | 🔵 Trivial | 💤 Low valueRemove unused
cspell-runplaceholder.This target does nothing and adds confusion. The Unix Makefile doesn't have an equivalent - docker run is inline in
cspell-check.🧹 Remove placeholder and references
Remove the label:
-:cspell-run -rem Placeholder for cspell-run -goto end -Remove from dispatch (line 8):
-if "%TARGET%"=="cspell-run" goto cspell-runRemove from help (line 14):
-echo cspell-run run cspell (placeholder)Remove call in cspell-check (line 45):
-call :cspell-run🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@cspell/make.cmd` around lines 33 - 35, Remove the unused cspell-run placeholder target and all references to it: delete the label and its two lines ("rem Placeholder for cspell-run" and "goto end") under ":cspell-run", and remove any references to ":cspell-run" from the dispatch logic, the help text, and the cspell-check target (i.e., remove the dispatch entry, the help listing, and the call/invocation inside the cspell-check target).cspell/package.json (1)
10-66:⚠️ Potential issue | 🔴 Critical | ⚡ Quick winMissing
@cspell/dict-pl-pland@cspell/dict-ru-rupackages.If
cspell.jsonreferences"pl-pl"and"ru-ru"dictionaries, these packages need to be in devDependencies or cspell will fail to load them.🐛 Add missing dictionary packages
"@cspell/dict-nl-nl": "^2.4.2", + "@cspell/dict-pl-pl": "^3.0.6", "@cspell/dict-pt-br": "^2.4.2", "@cspell/dict-pt-pt": "^3.0.6", "@cspell/dict-python": "^4.2.19", "@cspell/dict-ro-ro": "^2.0.6", + "@cspell/dict-ru-ru": "^2.3.2", "@cspell/dict-scientific-terms-gb": "^1.0.6",#!/bin/bash # Check if cspell.json references pl-pl and ru-ru dictionaries cat cspell/cspell.json | grep -E '"(pl-pl|ru-ru)"' || echo "Not found in cspell.json"🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@cspell/package.json` around lines 10 - 66, cspell is missing the Polish and Russian dictionaries referenced in cspell.json; add "@cspell/dict-pl-pl" and "@cspell/dict-ru-ru" to devDependencies in package.json (alongside existing entries like "@cspell/dict-en-gb" and "cspell") using matching semver style, then run your package manager to install; verify cspell.json still references "pl-pl" and "ru-ru" and that cspell loads without errors.tools/sort_cspell_dict.py (1)
30-39: 🧹 Nitpick | 🔵 Trivial | ⚡ Quick winCase-sensitive sort may scramble comments and allow near-duplicates.
The current implementation:
- Sorts comments alongside words (header
# Project-specific termscould move)- Dedupes case-sensitively, but cspell matching is typically case-insensitive
If this is intentional given the simple dictionary structure, that's fine. Otherwise, consider preserving comments at top and using case-insensitive deduplication.
♻️ Optional fix for comment preservation and case-insensitive dedupe
- # Remove duplicates while preserving order (case-sensitive) - seen = set() - unique_words = [] - for word in words: - if word not in seen: - seen.add(word) - unique_words.append(word) - - # Sort the words - unique_words.sort() + # Separate comments from words + comments = [w for w in words if w.startswith("#")] + raw_words = [w.strip() for w in words if w.strip() and not w.startswith("#")] + + # Case-insensitive dedupe + seen_ci = set() + unique_words = [] + for w in raw_words: + key = w.casefold() + if key not in seen_ci: + seen_ci.add(key) + unique_words.append(w) + + # Sort case-insensitively + unique_words.sort(key=str.casefold)🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@tools/sort_cspell_dict.py` around lines 30 - 39, The current loop dedupes case-sensitively and then does unique_words.sort(), which can move header comments and split near-duplicates; change the flow to first separate comment lines (lines starting with '#') into comment_lines and keep them at the top, then process only actual words from words into a deduplicated list by tracking seen_lower = set() (use word_lower = word.lower() and only add the first occurrence to preserve original casing), collect originals into unique_words, then sort unique_words using unique_words.sort(key=str.lower) to perform case-insensitive sorting; update references to seen/unique_words/words/unique_words.sort() accordingly so comments remain at top and dedupe/sort are case-insensitive.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@make.cmd`:
- Around line 21-23: The target :Sort-custom-dict currently runs python
tools/sort_cspell_dict.py but calls a bare Exit /B which discards the script's
exit code; update the target so it captures and returns the Python process exit
status (i.e., use the ERRORLEVEL after running tools/sort_cspell_dict.py and
pass it to Exit /B) so failures in tools/sort_cspell_dict.py propagate to the
caller.
---
Duplicate comments:
In `@cspell/make.cmd`:
- Around line 33-35: Remove the unused cspell-run placeholder target and all
references to it: delete the label and its two lines ("rem Placeholder for
cspell-run" and "goto end") under ":cspell-run", and remove any references to
":cspell-run" from the dispatch logic, the help text, and the cspell-check
target (i.e., remove the dispatch entry, the help listing, and the
call/invocation inside the cspell-check target).
In `@cspell/package.json`:
- Around line 10-66: cspell is missing the Polish and Russian dictionaries
referenced in cspell.json; add "@cspell/dict-pl-pl" and "@cspell/dict-ru-ru" to
devDependencies in package.json (alongside existing entries like
"@cspell/dict-en-gb" and "cspell") using matching semver style, then run your
package manager to install; verify cspell.json still references "pl-pl" and
"ru-ru" and that cspell loads without errors.
In `@make.cmd`:
- Around line 25-28: The call to launch the cspell make script in the
:Spellcheck block uses a hardcoded relative path ("call cspell\make.cmd
cspell-check") which can break with spaces or symlinked script locations; change
it to use the script directory expansion %~dp0 so the call becomes relative to
the current batch file folder (use "%~dp0cspell\make.cmd" when invoking from
:Spellcheck) to ensure paths with spaces and symlinks are handled correctly
while preserving the existing arguments.
In `@tools/sort_cspell_dict.py`:
- Around line 30-39: The current loop dedupes case-sensitively and then does
unique_words.sort(), which can move header comments and split near-duplicates;
change the flow to first separate comment lines (lines starting with '#') into
comment_lines and keep them at the top, then process only actual words from
words into a deduplicated list by tracking seen_lower = set() (use word_lower =
word.lower() and only add the first occurrence to preserve original casing),
collect originals into unique_words, then sort unique_words using
unique_words.sort(key=str.lower) to perform case-insensitive sorting; update
references to seen/unique_words/words/unique_words.sort() accordingly so
comments remain at top and dedupe/sort are case-insensitive.
🪄 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: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 7d210053-e9f5-4281-95b1-78d824063a20
📒 Files selected for processing (7)
Makefilecspell/Makefilecspell/custom-dict.txtcspell/make.cmdcspell/package.jsonmake.cmdtools/sort_cspell_dict.py
| :Sort-custom-dict | ||
| python tools/sort_cspell_dict.py | ||
| Exit /B |
There was a problem hiding this comment.
Propagate exit status from Python script.
Currently Exit /B doesn't return the script's exit code. If sort_cspell_dict.py fails, the caller won't know.
🔧 Proposed fix
:Sort-custom-dict
python tools/sort_cspell_dict.py
- Exit /B
+ Exit /B %ERRORLEVEL%📝 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.
| :Sort-custom-dict | |
| python tools/sort_cspell_dict.py | |
| Exit /B | |
| :Sort-custom-dict | |
| python tools/sort_cspell_dict.py | |
| Exit /B %ERRORLEVEL% |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@make.cmd` around lines 21 - 23, The target :Sort-custom-dict currently runs
python tools/sort_cspell_dict.py but calls a bare Exit /B which discards the
script's exit code; update the target so it captures and returns the Python
process exit status (i.e., use the ERRORLEVEL after running
tools/sort_cspell_dict.py and pass it to Exit /B) so failures in
tools/sort_cspell_dict.py propagate to the caller.
|
I'd like to see this check in CI somehow. |
|



Proposed change
Added spell checking functionality to pre-commit hooks and Makefile.
Resolves #2308.
Type of change
holidaysfunctionality in general)Checklist
make checklocally; all checks and tests passed.