Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,21 @@ repos:
hooks:
- id: tox-ini-fmt

- repo: local

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Make it part of make check instead

hooks:
- id: cspell
name: cspell
entry: cspell --config ./cspell/cspell.json

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 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 --cache

Add .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.

Suggested change
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.

files: \.(py|md|rst|txt|yml|yaml|po|ini|cfg|conf|env|toml|json|properties|xml)$

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 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.

Suggested change
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.

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)/$
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

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.

- 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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🛠️ 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: false

Add 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.


- repo: local
hooks:
- id: tests
Expand Down
9 changes: 9 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
-include cspell/Makefile

.PHONY: spellcheck

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 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.

help:
@echo "Usage: make <target>"
@echo " check run pre-commit and tests"
Expand All @@ -7,15 +11,20 @@ help:
@echo " package build package distribution"
@echo " pre-commit run pre-commit against all files"
@echo " setup setup development environment"
@echo " spellcheck run spell check on localization and documentation files"
@echo " test run tests (in parallel)"
@echo " tox run tox (in parallel)"

check:
make l10n
make pre-commit
make doc
make spellcheck
make test

Comment thread
coderabbitai[bot] marked this conversation as resolved.
spellcheck:
$(MAKE) cspell-check

Comment thread
coderabbitai[bot] marked this conversation as resolved.
Outdated
Comment on lines +34 to +37

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 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.

Suggested change
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.

clean:
@for ext in mo pot pyc; do \
find . -type f -name "*.$$ext" -delete; \
Expand Down
24 changes: 24 additions & 0 deletions cspell/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
FROM node:20-alpine

# Set working directory for node modules installation
WORKDIR /app

# Copy package.json and package-lock.json to install dependencies
COPY package.json package-lock.json ./
Comment thread
coderabbitai[bot] marked this conversation as resolved.

# Install cspell and dictionaries locally using npm ci with security flags
RUN npm ci --ignore-scripts --no-audit --no-fund && npm cache clean --force

# Set working directory for the application
WORKDIR /holidays

# Copy cspell configuration and custom dictionary
COPY cspell.json cspell/cspell.json
COPY custom-dict.txt cspell/custom-dict.txt
Comment on lines +15 to +17

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick (assertive)

Optional: avoid baking config into the image to keep builds cacheable.

Since runtime bind-mounts the repo at /holidays, you can drop copying cspell.json/custom-dict.txt to reduce rebuild churn when dictionaries change.

-# Copy cspell configuration and custom dictionary
-COPY cspell.json cspell/cspell.json
-COPY custom-dict.txt cspell/custom-dict.txt
+# Config and dictionaries come from the bind mount at runtime.
📝 Committable suggestion

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

Suggested change
# Copy cspell configuration and custom dictionary
COPY cspell.json cspell/cspell.json
COPY custom-dict.txt cspell/custom-dict.txt
# Config and dictionaries come from the bind mount at runtime.
🤖 Prompt for AI Agents
In cspell/Dockerfile around lines 15 to 17, remove the two COPY commands that
bake cspell.json and custom-dict.txt into the image to avoid rebuild churn;
instead rely on the runtime bind-mounted repo (e.g. /holidays) so the container
reads cspell configuration from the mounted path, and update any comments or
references in the Dockerfile to point to the mounted location; if you need a
fallback for CI, add an optional build-time argument or a short conditional step
rather than copying files unconditionally.


# Use non-root user for security
USER node

# Set entrypoint to local cspell binary
ENTRYPOINT ["/app/node_modules/.bin/cspell"]
CMD ["--help"]
16 changes: 16 additions & 0 deletions cspell/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
.PHONY: cspell-install cspell-check cspell-run

cspell-install:
@DOCKER_BUILDKIT=1 docker build \
$(if $(FORCE),--no-cache,) \
-f cspell/Dockerfile \
. \
-t cspell
Comment thread
coderabbitai[bot] marked this conversation as resolved.

cspell-check: CMD=--no-progress -r /holidays
cspell-check: cspell-install cspell-run
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Outdated

@docker run \
--mount type=bind,src="$(CURDIR)",dst=/holidays \
--rm \
cspell -c cspell/cspell.json $(CMD)
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Outdated
108 changes: 108 additions & 0 deletions cspell/cspell.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
{
"allowCompoundWords": false,
"caseSensitive": false,
"language": "en",
"minWordLength": 3,
"dictionaryDefinitions": [
{
"addWords": true,
"name": "custom-dict",
"path": "custom-dict.txt"
},
{
"name": "hi",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This is not what we want. Try resolving it with existing dictionaries.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I have already included every available dictionary as a dependency. Here is the complete list for reference:
Natural Language Dictionaries

"path": "dictionaries/hindi/hi.txt"
}
],
"dictionaries": [
"ar",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

My understanding is that all of them need to be installed as dependencies.

"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",
"hi",
"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"
],
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Comment on lines +13 to +72

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 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.

Comment on lines +12 to +72

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 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.

Suggested change
],
"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.

"enabled": true,
"files": ["**/*"],
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Outdated
"ignorePaths": [
"node_modules/**",
".git/**",
".venv/**",
"__pycache__/**",
"*.pyc",
"dist/**",
"build/**",
".mypy_cache/**",
".pytest_cache/**",
"docs/_build/**",
"snapshots/**",
"*.egg-info/**",
".tox/**",
"requirements/*.txt",
"cspell/dictionaries/**"
Comment on lines +81 to +95

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

do we need all of them?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Which of these do you consider unnecessary or redundant? Should I remove any specific ones?

],
Comment on lines +81 to +96

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 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.

"ignoreRegExpList": [
"#\\w+",
"<@\\w+>",
"\\b[A-Z]{2,}\\b",
"\\b[A-Z][a-z]+\\s+[A-Z][a-z]+\\b",
Comment thread
coderabbitai[bot] marked this conversation as resolved.
"\\b\\d+\\b",
"\\b[A-Za-z]+_[A-Za-z]+\\b",
"\\bhttps?:\\/\\/[^\\s]+\\b"
],

"useGitignore": true
}
33 changes: 33 additions & 0 deletions cspell/custom-dict.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Project-specific terms
API
CD
CI
CLI
COA
CNR
DOI
GitHub
JSON
PyPI
Rica

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Trim risky entries that can mask typos.

  • “Rica” and “holidaysum” look project-specific; keep only if referenced.
  • “pyc” is an extension; better handled via ignore patterns than whitelisting a word.

Quick audit to justify keeping them:

If unused, remove them to reduce false negatives.

Also applies to: 22-22, 28-29


🏁 Script executed:

#!/bin/bash
rg -nC1 -g '!**/node_modules/**' -P '\b(Rica|holidaysum|pyc)\b' || true

Length of output: 34146


Trim unused entries from custom-dict
Remove “holidaysum” (line 22) and “pyc” (line 28) — neither appear outside the custom dictionary. Keep “Rica” (line 12) since it’s referenced across tests, docs, and code.

🤖 Prompt for AI Agents
In cspell/custom-dict.txt around lines 12–28, trim unused entries by removing
the words "holidaysum" (line 22) and "pyc" (line 28) from the custom dictionary
while keeping "Rica" (line 12) intact; edit the file to delete those two lines,
save, and run the spelling/test suite to confirm no references were removed
inadvertently.

TKL
TVL
Vacanza
YAML
coa
cnr
dateutil
datetime
holidays
holidaysum
ical
i18n
ics
l10n
pre-commit
pyc
pytz
subdiv
tkl
tvl
timezone
24 changes: 24 additions & 0 deletions cspell/dictionaries/hindi/hi.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
गणतंत्र
दिवस
होली
राम
नवमी
महावीर
जयंती
गुड
फ्राइडे
बाबा
साहेब
अम्बेडकर

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick (assertive)

Include alternate spelling for Ambedkar.

Both “अम्बेडकर” and “अंबेडकर” occur in sources.

Apply:

 अम्बेडकर
+अंबेडकर
📝 Committable suggestion

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

Suggested change
अम्बेडकर
अम्बेडकर
अंबेडकर
🤖 Prompt for AI Agents
cspell/dictionaries/hindi/hi.txt around line 12: add the alternate spelling
"अंबेडकर" on its own line next to the existing entry "अम्बेडकर" (ensure UTF-8
encoding and follow the file's one-word-per-line convention), so both variants
are present for spellchecking.

महाराष्ट्र
बकरी

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Fix festival name.

“बकरी” should be “बकरीद”.

Apply:

- बकरी
+ बकरीद
📝 Committable suggestion

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

Suggested change
बकरी
बकरीद
🤖 Prompt for AI Agents
In cspell/dictionaries/hindi/hi.txt around line 14 the festival name entry
"बकरी" is incorrect; replace it with the correct term "बकरीद" by updating that
line to the corrected spelling so the dictionary contains the proper festival
name.

स्वतंत्रता
गणेश
चतुर्थी
महात्मा
दशहरा
दिवाली
बलिप्रतिपदा

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick (assertive)

Add common variants to reduce false positives.

Include frequent spellings for Diwali.

Apply:

 दिवाली
+दीवाली
+दीपावली
📝 Committable suggestion

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

Suggested change
दिवाली
बलिप्रतिपदा
दिवाली
दीवाली
दीपावली
बलिप्रतिपदा
🤖 Prompt for AI Agents
In cspell/dictionaries/hindi/hi.txt around lines 20-21, add common variants of
"दिवाली" to reduce false positives by including frequent spellings such as
"दीपावली" and "दीवाली" (and optionally "दिवाळी" if regional Marathi variants are
desired); update the list so these variants appear alongside the existing
entries (e.g., insert the new spellings on adjacent lines) to ensure the
spellchecker recognizes them.

गुरु
नानक
क्रिसमस
22 changes: 22 additions & 0 deletions cspell/dictionaries/hindi/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"name": "@cspell/dict-hi",
"version": "1.0.0",
"description": "Hindi dictionary for cspell",
"main": "cspell-ext.json",
"files": [
"hi.txt",
"cspell-ext.json"
],

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Verify cspell-ext.json is present and referenced correctly.

It’s listed as main and in files. Ensure the file exists at this path.


🏁 Script executed:

#!/bin/bash
test -f cspell/dictionaries/hindi/cspell-ext.json && echo "OK: cspell-ext.json present" || (echo "Missing: cspell-ext.json" && exit 1)

Length of output: 119


Add missing cspell-ext.json in cspell/dictionaries/hindi
cspell-ext.json is referenced as both “main” and in “files” but doesn’t exist; include it in that directory or update package.json to correct the references.

🤖 Prompt for AI Agents
In cspell/dictionaries/hindi/package.json around lines 5 to 9, package.json
declares "main": "cspell-ext.json" and includes "cspell-ext.json" in "files" but
that file is missing; either add a valid cspell-ext.json into the
cspell/dictionaries/hindi directory (containing the expected spellchecker
config/exports) or update package.json to point to the correct existing file
name(s) (and remove any non-existent entries from "files"); ensure the "main"
field and "files" array accurately reference actual files and bump version if
needed.

"scripts": {
"test": "cspell test hi.txt"
},
"keywords": [
"cspell",
"cspell-ext",
"dictionary",
"hindi",
"hi"
],
"author": "Holidays Project",
"license": "MIT"
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Make tests reliable: add cspell as a devDependency (or mark package private).

"test": "cspell test hi.txt" will fail without a local cspell. If this package isn’t meant for publish, mark it "private": true; otherwise, add devDeps.

Apply one of:

 {
   "name": "@cspell/dict-hi",
+  "private": true,
   "version": "1.0.0",
   "description": "Hindi dictionary for cspell",
   "main": "cspell-ext.json",
   "files": [
     "hi.txt",
     "cspell-ext.json"
   ],
   "scripts": {
     "test": "cspell test hi.txt"
   },
+  "devDependencies": {
+    "cspell": "^8.0.0"
+  },
   "keywords": [
📝 Committable suggestion

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

Suggested change
{
"name": "@cspell/dict-hi",
"version": "1.0.0",
"description": "Hindi dictionary for cspell",
"main": "cspell-ext.json",
"files": [
"hi.txt",
"cspell-ext.json"
],
"scripts": {
"test": "cspell test hi.txt"
},
"keywords": [
"cspell",
"cspell-ext",
"dictionary",
"hindi",
"hi"
],
"author": "Holidays Project",
"license": "MIT"
}
{
"name": "@cspell/dict-hi",
"private": true,
"version": "1.0.0",
"description": "Hindi dictionary for cspell",
"main": "cspell-ext.json",
"files": [
"hi.txt",
"cspell-ext.json"
],
"scripts": {
"test": "cspell test hi.txt"
},
"devDependencies": {
"cspell": "^8.0.0"
},
"keywords": [
"cspell",
"cspell-ext",
"dictionary",
"hindi",
"hi"
],
"author": "Holidays Project",
"license": "MIT"
}
🤖 Prompt for AI Agents
In cspell/dictionaries/hindi/package.json lines 1-22, the package's "test"
script calls the global tool "cspell" which will fail in CI/local without a
local install; either mark the package private or add cspell as a devDependency.
Fix by choosing one: 1) if the package is not intended to be published, add
"private": true at the top-level of package.json; or 2) if it should be
publishable, add "devDependencies": { "cspell": "<appropriate-version>" } (run
npm/yarn install afterwards). After the change, run the test script to verify it
passes.

38 changes: 38 additions & 0 deletions cspell/make.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
@echo off
setlocal enabledelayedexpansion

set TARGET=%1

if "%TARGET%"=="cspell-check" goto cspell-check
if "%TARGET%"=="cspell-install" goto cspell-install
if "%TARGET%"=="cspell-run" goto cspell-run

echo Usage: make.cmd ^<target^>
echo cspell-check run cspell check
echo cspell-install install cspell docker image
echo cspell-run run cspell (placeholder)
goto end

:cspell-install
where docker-credential-desktop >nul 2>nul
if %errorlevel% neq 0 (
echo ERROR: docker-credential-desktop not found in PATH.
echo Please add Docker's bin directory to your PATH.
echo Typically: set PATH=%%PATH%%;C:\Program Files\Docker\Docker\resources\bin
echo Or reinstall Docker Desktop to fix credential helper.
goto end
)
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Outdated
set "DOCKER_BUILDKIT=true" && docker build -f cspell/Dockerfile cspell -t cspell
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Outdated
goto end
Comment on lines +18 to +31

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 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.

Suggested change
: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-run
rem Placeholder for cspell-run
goto end
Comment on lines +33 to +35

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 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-run

And 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.


:cspell-check
call :cspell-install
call :cspell-run
docker run --mount type=bind,src="%CD%",dst=/holidays --rm cspell lint -c cspell/cspell.json --no-progress -r /holidays
goto end
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Comment on lines +41 to +47

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 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.

Suggested change
: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.


:end
Loading
Loading