Skip to content

Commit d77fe1e

Browse files
committed
codespell: Add codespell configuration, CI and precommit.
Signed-off-by: Jos Verlinde <Jos.Verlinde@Microsoft.com>
1 parent b312524 commit d77fe1e

File tree

3 files changed

+32
-0
lines changed

3 files changed

+32
-0
lines changed

.github/workflows/codespell.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: Check spelling with codespell
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
codespell:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v5
10+
# codespell version should be kept in sync with .pre-commit-config.yml
11+
- run: pip install --user codespell==2.4.1 tomli
12+
- run: codespell
13+

.pre-commit-config.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,11 @@ repos:
1313
hooks:
1414
- id: ruff
1515
id: ruff-format
16+
17+
- repo: https://github.com/codespell-project/codespell
18+
rev: v2.4.1
19+
# version should be kept in sync with .github/workflows/codespell.yml & micropython repo
20+
hooks:
21+
- id: codespell
22+
additional_dependencies:
23+
- tomli

pyproject.toml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
[tool.codespell]
2+
count = ""
3+
ignore-regex = '\b[A-Z]{3}\b'
4+
ignore-words-list = "ans,asend,deques,dout,emac,extint,hsi,iput,mis,notin,numer,ser,shft,synopsys,technic,ure,curren,te,bu,curch,ist,clen,henc,shttp,unstall,ody"
5+
quiet-level = 3
6+
skip = """
7+
./.git,\
8+
**/test_*.py,\
9+
**/html.entities/html/entities.py,\
10+
"""
11+
112
[tool.ruff]
213
extend-exclude = [
314
"python-stdlib",

0 commit comments

Comments
 (0)