Skip to content

Commit 85e7003

Browse files
yuluo-yxrootfs
andauthored
feat: add codespell check and tidy linter check config files (#159)
Signed-off-by: yuluo-yx <[email protected]> Co-authored-by: Huamin Chen <[email protected]>
1 parent 6e79ddb commit 85e7003

File tree

7 files changed

+30
-5
lines changed

7 files changed

+30
-5
lines changed

.github/workflows/pre-commit.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
build-essential \
4848
pkg-config
4949
npm install -g markdownlint-cli
50-
pip install --user yamllint
50+
pip install --user yamllint codespell
5151
5252
- name: Cache Rust dependencies
5353
uses: actions/cache@v4
@@ -83,6 +83,9 @@ jobs:
8383
- name: Install pre-commit
8484
run: pip install pre-commit
8585

86+
- name: Run Code Spell Check
87+
run: make codespell
88+
8689
- name: Run pre-commit on Go, Rust, JavaScript, Markdown, Yaml and Python files
8790
run: |
8891
# Find all Go, Rust, JavaScripts, Markdown and Python files (excluding vendored/generated code)
File renamed without changes.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
.git
2+
.idea
3+
*.png
4+
*.woff
5+
*.woff2
6+
*.eot
7+
*.ttf
8+
*.jpg
9+
*.ico
10+
*.svg
11+
*.js
12+
13+
./website/public/*
14+
./website/node_modules/*
15+
./website/package-lock.json
16+
./candle-binding/target
File renamed without changes.
File renamed without changes.

tools/make/linter.mk

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# =============================== linter.mk ==========================
2-
# = Everything For Project Linter, markdown, yaml, code spell etc. =
2+
# = Everything For Project Linter, markdown, yaml, code spell etc. =
33
# =============================== linter.mk ==========================
44

55
docs-lint:
@@ -12,12 +12,17 @@ docs-lint-fix:
1212

1313
markdown-lint:
1414
@$(LOG_TARGET)
15-
markdownlint -c markdownlint.yaml "**/*.md" --ignore node_modules --ignore website/node_modules
15+
markdownlint -c tools/linter/markdown/markdownlint.yaml "**/*.md" --ignore node_modules --ignore website/node_modules
1616

1717
markdown-lint-fix:
1818
@$(LOG_TARGET)
19-
markdownlint -c markdownlint.yaml "**/*.md" --ignore node_modules --ignore website/node_modules --fix
19+
markdownlint -c tools/linter/markdown/markdownlint.yaml "**/*.md" --ignore node_modules --ignore website/node_modules --fix
2020

2121
yaml-lint:
2222
@$(LOG_TARGET)
23-
yamllint --config-file=.yamllint .
23+
yamllint --config-file=tools/linter/yaml/.yamllint .
24+
25+
codespell: CODESPELL_SKIP := $(shell cat tools/linter/codespell/.codespell.skip | tr \\n ',')
26+
codespell:
27+
@$(LOG_TARGET)
28+
codespell --skip $(CODESPELL_SKIP) --ignore-words tools/linter/codespell/.codespell.ignorewords --check-filenames

0 commit comments

Comments
 (0)