Skip to content

Commit 0a6219e

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

File tree

4 files changed

+43
-0
lines changed

4 files changed

+43
-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+
# version should be kept in sync with .github/workflows/codespell.yml & micropython repo
19+
rev: v2.4.1
20+
hooks:
21+
- id: codespell
22+
additional_dependencies:
23+
- tomli

pyproject.toml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
[tool.codespell]
2+
count = ""
3+
ignore-regex = '\b[A-Z]{3}\b'
4+
ignore-multiline-regex = "# codespell:ignore-begin *\n.*# codespell:ignore-end *\n"
5+
ignore-words = "tools/ignore_words.txt"
6+
quiet-level = 3
7+
skip = """
8+
./.git,\
9+
"""
10+
111
[tool.ruff]
212
extend-exclude = [
313
"python-stdlib",

tools/ignore_words.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# non-words to be ignored by codespell
2+
# shared with micropython/micropython
3+
asend
4+
ure
5+
6+
# Specific to micropython/micropython-lib
7+
bu
8+
curch
9+
ist
10+
clen
11+
shttp
12+
ody

0 commit comments

Comments
 (0)