-
-
Notifications
You must be signed in to change notification settings - Fork 705
Added spell checking functionality to pre-commit hooks and Makefile. #2898
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Prateekshit73
wants to merge
14
commits into
vacanza:dev
Choose a base branch
from
Prateekshit73:comprehensive-spell-checking
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
2420d52
Added spell checking functionality to pre-commit hooks and Makefile.
Prateekshit73 33a9d38
Merge branch 'dev' into comprehensive-spell-checking
Prateekshit73 0a98658
Update cspell dependencies and configuration.
Prateekshit73 f0c8419
Merge branch 'comprehensive-spell-checking' of https://github.com/Pra…
Prateekshit73 336879a
Merge branch 'dev' into comprehensive-spell-checking
Prateekshit73 cc11806
Merge branch 'dev' into comprehensive-spell-checking
Prateekshit73 4fcc4f6
Merge branch 'dev' into comprehensive-spell-checking
Prateekshit73 5346c25
Refine spellcheck command descriptions and enhance error handling in …
Prateekshit73 d074539
Merge branch 'dev' into comprehensive-spell-checking
Prateekshit73 cec8f98
Merge branch 'dev' into comprehensive-spell-checking
Prateekshit73 ab60110
Merge branch 'dev' into comprehensive-spell-checking
Prateekshit73 d7893c1
Merge branch 'dev' into comprehensive-spell-checking
Prateekshit73 a4c6417
Merge branch 'dev' into comprehensive-spell-checking
Prateekshit73 ab77833
Add spellcheck workflow to CI/CD and update .gitignore to include nod…
Prateekshit73 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,6 +22,7 @@ dist/ | |
| docs/auto_gen_files/ | ||
| holidays/locale/pot/*.pot | ||
| MANIFEST | ||
| node_modules/ | ||
| Pipfile | ||
| sbom.json | ||
| site/ | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 ./ | ||
|
|
||
| # 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 | ||
|
|
||
| # Use non-root user for security | ||
| USER node | ||
|
|
||
| # Set entrypoint to local cspell binary | ||
| ENTRYPOINT ["/app/node_modules/.bin/cspell"] | ||
| CMD ["--help"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| .PHONY: cspell-install cspell-check 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 | ||
|
|
||
| cspell-check: CMD=--no-progress -r /holidays | ||
| cspell-check: cspell-install | ||
|
|
||
| @docker run \ | ||
| --mount type=bind,src="$(CURDIR)",dst=/holidays,readonly \ | ||
| --rm \ | ||
| cspell lint -c cspell/cspell.json $(CMD) | ||
|
|
||
| sort-custom-dict: | ||
| @python tools/sort_cspell_dict.py |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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", | ||
| "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" | ||
| ], | ||
| "enabled": true, | ||
| "files": [ | ||
| "docs/**/*", | ||
| "README.md", | ||
| "scripts/l10n/**/*", | ||
| "mkdocs.yml" | ||
| ], | ||
| "ignorePaths": [ | ||
| "node_modules/**", | ||
| ".git/**", | ||
| ".venv/**", | ||
| "__pycache__/**", | ||
| "*.pyc", | ||
| "dist/**", | ||
| "build/**", | ||
| ".mypy_cache/**", | ||
| ".pytest_cache/**", | ||
| "docs/_build/**", | ||
| "snapshots/**", | ||
| "*.egg-info/**", | ||
| ".tox/**", | ||
| "requirements/*.txt", | ||
| "cspell/dictionaries/**" | ||
| ], | ||
| "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" | ||
| ], | ||
|
|
||
| "useGitignore": true | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| # Project-specific terms | ||
| Día | ||
| Nāgā | ||
| Río | ||
| mofile | ||
| ārā | ||
| วันสงกรานต์ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| @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 | ||
| if %errorlevel% neq 0 ( | ||
| echo ERROR: Docker build failed. | ||
| goto end | ||
| ) | ||
| goto end | ||
|
|
||
| :cspell-run | ||
| rem Placeholder for cspell-run | ||
| goto end | ||
|
Comment on lines
+33
to
+35
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 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 |
||
|
|
||
| :sort-custom-dict | ||
| python tools/sort_cspell_dict.py | ||
| goto end | ||
|
|
||
| :cspell-check | ||
| set CMD=--no-progress -r /holidays | ||
| call :cspell-install | ||
| if %errorlevel% neq 0 goto end | ||
| call :cspell-run | ||
| docker run --mount type=bind,src="%CD%",dst=/holidays,readonly --rm cspell lint -c cspell/cspell.json %CMD% | ||
| goto end | ||
|
|
||
| :end | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.