Skip to content

Commit 4bb19ca

Browse files
ci: Add typos spell check
Run typos in the lint job and as a pre-commit hook so misspellings get caught on the PR instead of in a cleanup pass. The config allowlists the intentional spellings left alone in #8241. Co-Authored-By: Ivana Kellyer <131587164+sentrivana@users.noreply.github.com>
1 parent ae73d8c commit 4bb19ca

5 files changed

Lines changed: 49 additions & 0 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ jobs:
3434
- name: Ruff format
3535
run: uv run ruff format --check tests sentry_sdk
3636

37+
- name: Typos
38+
run: uv run typos --hidden
39+
3740
- name: Find raise from None
3841
run: uv run python scripts/find_raise_from_none.py
3942

‎.pre-commit-config.yaml‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,9 @@ repos:
1515
language: system
1616
types_or: [python, pyi]
1717
require_serial: true
18+
- id: typos
19+
name: typos
20+
entry: uv run typos --force-exclude
21+
language: system
22+
types: [text]
23+
require_serial: true

‎_typos.toml‎

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Spell checker config, see https://github.com/crate-ci/typos/blob/master/docs/reference.md
2+
3+
[default]
4+
extend-ignore-re = [
5+
"baGGage", # tests that header matching ignores case
6+
"need_code_loation", # old method name quoted in MIGRATION_GUIDE.md
7+
"deprecat\\(", # regex prefix in .github/release.yml
8+
]
9+
10+
[default.extend-words]
11+
GAE = "GAE" # Google App Engine
12+
certifi = "certifi" # package name
13+
unparseable = "unparseable"
14+
# Chunked strings and key prefixes in tests
15+
abl = "abl"
16+
hel = "hel"
17+
18+
[files]
19+
extend-exclude = [
20+
".git/",
21+
"CHANGELOG.md", # historical release notes
22+
"checkouts/", # third-party submodules
23+
]

‎pyproject.toml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ dev = [
1212
"coverage[toml]",
1313
"pre-commit",
1414
"ruff",
15+
"typos",
1516
]
1617

1718
toxgen = [

‎uv.lock‎

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)