Skip to content

Commit a9004ff

Browse files
authored
feat: add cspell hook (#72)
1 parent dcfe7c8 commit a9004ff

File tree

6 files changed

+1246
-23
lines changed

6 files changed

+1246
-23
lines changed

.config/dictionary.txt

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,6 @@
11
Sbarnea
22
Sorin
3-
autobuild
4-
autofix
5-
autoupdate
6-
codenotify
7-
codeql
83
codespell
9-
devel
10-
dmypy
114
envlist
12-
exuo
135
minmax
14-
mkdocs
15-
pyenv
16-
pypa
176
showlocals
18-
ssbarnea
19-
tombi

.pre-commit-config.yaml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,6 @@ repos:
3939
name: biome
4040
alias: biome
4141
args: [--unsafe]
42-
- repo: https://github.com/streetsidesoftware/cspell-cli
43-
rev: v9.6.0
44-
hooks:
45-
- id: cspell
46-
name: cspell
47-
# entry: codespell --relative
48-
args: [--relative, --no-progress, --no-summary]
4942
- repo: https://github.com/rhysd/actionlint
5043
rev: v1.7.10
5144
hooks:

.pre-commit-hooks.yaml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
# cspell: ignore ansiblelint
2+
# cspell: ignore ansiblelint tombi
33
# hooks that rely on uv to track dependencies instead of pre-commit hooks
44
# Order matters: faster hooks first, also auto-formatters being prioritized
55
- id: toml
@@ -74,3 +74,18 @@
7474
files: \.(yaml|yml)$
7575
types: [file, yaml]
7676
entry: uv run -q --group lint yamllint --strict
77+
- id: cspell
78+
name: cspell + remove unused and sort dictionary
79+
# see https://github.com/streetsidesoftware/cspell-cli/issues/686
80+
# requires cspell-cli npm dependency
81+
entry: bash
82+
language: system
83+
pass_filenames: false
84+
always_run: true
85+
args:
86+
- "-euo"
87+
- "pipefail"
88+
- "-c"
89+
- "npm exec cspell-cli -- . --relative --no-progress --no-summary && { NEW_DICT=$(npm exec cspell-cli -- . --disable-dictionary=words --no-exit-code --words-only
90+
--quiet --unique | LC_ALL=C sort); if [ \"$NEW_DICT\" != \"$(cat .config/dictionary.txt 2>/dev/null || true)\" ]; then echo \"$NEW_DICT\" > .config/dictionary.txt;
91+
fi; }"

cspell.config.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,9 @@ dictionaries:
1212
- python-common
1313
enabled: true
1414
ignorePaths:
15-
- cspell.config.yaml
15+
- "**/*.egg-info/**"
16+
- ".tox/**"
1617
- ".vscode/**"
18+
- .github/CODEOWNERS
19+
- .gitignore
20+
- cspell.config.yaml

0 commit comments

Comments
 (0)