Skip to content
Open
Show file tree
Hide file tree
Changes from 5 commits
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
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ repos:
- repo: https://github.com/asottile/pyupgrade
rev: v3.20.0
hooks:
- id: pyupgrade
- id: pyupgrade
args:
- --py39-plus

Expand Down Expand Up @@ -61,7 +61,7 @@ repos:
- id: pyproject-fmt

- repo: https://github.com/tox-dev/tox-ini-fmt
rev: '1.6.0'
rev: "1.6.0"
hooks:
- id: tox-ini-fmt

Expand Down
13 changes: 13 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,24 @@ 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 across the repository (code, docs, l10n)"
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Outdated
@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.
sort-custom-dict:
python tools/sort_cspell_dict.py
Comment thread
coderabbitai[bot] marked this conversation as resolved.

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

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"]
20 changes: 20 additions & 0 deletions cspell/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
.PHONY: cspell-install cspell-check cspell-run sort-custom-dict

cspell-install:
@which docker > /dev/null 2>&1 || (echo "ERROR: docker not found in PATH. Install Docker."; exit 1)
@DOCKER_BUILDKIT=1 docker build \
$(if $(FORCE),--no-cache,) \
-f cspell/Dockerfile \
cspell \
-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,readonly \
--rm \
cspell lint -c cspell/cspell.json $(CMD)
Comment on lines +14 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)

Speed up with caching (container run).

Reuse cache between runs; add .cspellcache to .gitignore.

 	@docker run \
 	--mount type=bind,src="$(CURDIR)",dst=/holidays,readonly \
 	--rm \
-	cspell lint -c cspell/cspell.json $(CMD)
+	cspell lint -c cspell/cspell.json --cache --cache-location /holidays/.cspellcache $(CMD)

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In cspell/Makefile around lines 14 to 17, the docker cspell invocation doesn't
reuse a cache between runs; modify the docker run to mount a persistent cache
file/directory from the repo (e.g. bind-mount $(CURDIR)/.cspellcache into the
container cache path cspell uses) so subsequent runs are faster, and add
.cspellcache to .gitignore in the repo root; ensure the container invocation
still uses --rm and the mount path matches where cspell expects its cache (or
set the cache path via env/CLI) so the cache is persisted across runs.


sort-custom-dict:
@python tools/sort_cspell_dict.py
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"
}
],
"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",
"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": [
"docs/**/*",
"README.md",
"scripts/l10n/**/*",
"mkdocs.yml"
],
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Comment on lines +74 to +79

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

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.

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

"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
}
1 change: 1 addition & 0 deletions cspell/custom-dict.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Project-specific terms\n
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Outdated
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Outdated
44 changes: 44 additions & 0 deletions cspell/make.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
@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
if "%TARGET%"=="sort-custom-dict" goto sort-custom-dict

echo Usage: make.cmd ^<target^>
echo cspell-check run cspell check
echo cspell-install install cspell docker image
echo cspell-run run cspell (placeholder)
echo sort-custom-dict sort and uniquify custom-dict.txt
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
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.


:sort-custom-dict
python tools/sort_cspell_dict.py
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%

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)

Speed up with caching.

Persist cache in repo to cut repeat runtime; add to .gitignore.

-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 --cache --cache-location /holidays/.cspellcache %CMD%

Add “.cspellcache” to .gitignore.

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In cspell/make.cmd around line 41, the docker run invocation doesn’t persist
cspell’s cache; add a repo-level .cspellcache file and add “.cspellcache” to
.gitignore, then update the docker run to bind-mount that file into the
container (so cspell can reuse it across runs) and, if necessary, pass the
cspell option or env var to point to the mounted cache location; ensure the
cache file is created if missing before running.

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