Skip to content

Commit cfaa0a5

Browse files
committed
Add spell checker
1 parent c826295 commit cfaa0a5

4 files changed

Lines changed: 56 additions & 1 deletion

File tree

.github/workflows/ci.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@ jobs:
4343
- name: Check formatting
4444
run: npm run format:check
4545

46+
- name: Check for typos
47+
uses: crate-ci/typos@8e6a4285bcbde632c5d79900a7779746e8b7ea3f
48+
with:
49+
config: ./typos.toml
50+
4651
- name: Lint
4752
run: npm run lint
4853

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@
4242
"format:check": "prettier --check . && cargo fmt -- --check",
4343
"lint": "cargo clippy",
4444
"lint:fix": "cargo clippy --fix",
45-
"check": "npm run lint && npm run format:check && npm run build && npm run test && npm run docs:ts:verify",
45+
"spellcheck": "./scripts/spellcheck.sh",
46+
"spellcheck:fix": "./scripts/spellcheck.sh --write-changes",
47+
"check": "npm run lint && npm run format:check && npm run spellcheck && npm run build && npm run test && npm run docs:ts:verify",
4648
"docs": "cd docs && npx mint@4.2.93 dev",
4749
"docs:ts:build": "cd typescript && typedoc && echo 'TypeScript documentation generated in ./typescript/docs'",
4850
"docs:ts:dev": "concurrently \"cd typescript && typedoc --watch --preserveWatchOutput\" \"npx http-server typescript/docs -p 8081\"",

scripts/spellcheck.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/bash
2+
3+
# Check if typos is installed
4+
if ! command -v typos &> /dev/null; then
5+
echo "Error: typos is not installed."
6+
echo "Please install it using one of the following methods:"
7+
echo ""
8+
echo " Using Cargo:"
9+
echo " cargo install typos-cli"
10+
echo ""
11+
echo ""
12+
echo "For more installation options, see: https://github.com/crate-ci/typos"
13+
exit 1
14+
fi
15+
16+
# Run typos with the provided arguments, defaulting to current directory
17+
if [ $# -eq 0 ]; then
18+
typos --config ./typos.toml
19+
else
20+
typos --config ./typos.toml "$@"
21+
fi

typos.toml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
[files]
2+
ignore-files = true
3+
ignore-hidden = false
4+
extend-exclude = [
5+
".git/",
6+
"target/",
7+
"node_modules/",
8+
"dist/",
9+
10+
# Generated schema files
11+
"schema/",
12+
13+
# Package lock files contain hashes and encoded data
14+
"package-lock.json",
15+
"Cargo.lock",
16+
17+
# TypeScript documentation output
18+
"typescript/docs/",
19+
20+
# Build artifacts
21+
"tsconfig.tsbuildinfo",
22+
]
23+
24+
[default]
25+
extend-ignore-re = [
26+
]
27+
check-filename = true

0 commit comments

Comments
 (0)