Skip to content

Commit e9c62e5

Browse files
ci: Add typos spell check (#8279)
This one is more for humans rather than agents, but still nice to have. ### Description Adds [typos](https://github.com/crate-ci/typos) to the CI lint job and to pre-commit, so misspellings get caught on the PR and we don't need cleanup passes like #8241. It comes in through the `dev` dependency group, like ruff. `_typos.toml` allowlists the spellings that #8241 kept on purpose (`baGGage`, the `deprecat` regex, chunked test strings), plus `GAE` and `certifi`. It also skips `CHANGELOG.md`, since those are historical release notes. A couple of spellings get fixed instead of allowlisted: - The `MIGRATION_GUIDE.md` entry about the `MetricsAggregator` method rename is reworded so it no longer spells out the old misspelled name. - The aiohttp test `test_tracing_unparseable_url` is renamed to `test_tracing_unparsable_url`. CI also scans hidden files, so `.github/` gets checked the same way the pre-commit hook checks it. typos has fewer false positives on this repo than codespell, which flags names like `checkin` and `dependant`. <!-- junior-request-attribution:start --> via @sentrivana. <!-- junior-request-attribution:end --> <!-- junior-session-footer:start --> <!-- junior-conversation-id:slack%3AC0BTREZTS2Z%3A1794835840.831269 --> -- [View Session](https://junior-prod.sentry.dev/conversations/slack%3AC0BTREZTS2Z%3A1794835840.831269) [[Sentry]](https://sentry.sentry.io/explore/conversations/slack%3AC0BTREZTS2Z%3A1794835840.831269/?project=4510944073809921) <!-- junior-session-footer:end --> --------- Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com> Co-authored-by: Ivana Kellyer <131587164+sentrivana@users.noreply.github.com>
1 parent 03839c9 commit e9c62e5

7 files changed

Lines changed: 50 additions & 3 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

‎MIGRATION_GUIDE.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Looking to upgrade from Sentry SDK 1.x to 2.x? Here's a comprehensive list of wh
1010
## Changed
1111

1212
- The Pyramid integration will not capture errors that might happen in `authenticated_userid()` in a custom `AuthenticationPolicy` class.
13-
- The method `need_code_loation` of the `MetricsAggregator` was renamed to `need_code_location`.
13+
- A typo in the name of the `MetricsAggregator` method `need_code_location` was fixed.
1414
- The `BackgroundWorker` thread used to process events was renamed from `raven-sentry.BackgroundWorker` to `sentry-sdk.BackgroundWorker`.
1515
- The `reraise` function was moved from `sentry_sdk._compat` to `sentry_sdk.utils`.
1616
- The `_ScopeManager` was moved from `sentry_sdk.hub` to `sentry_sdk.scope`.

‎_typos.toml‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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+
"deprecat\\(", # regex prefix in .github/release.yml
7+
]
8+
9+
[default.extend-words]
10+
GAE = "GAE" # Google App Engine
11+
certifi = "certifi" # package name
12+
# Chunked strings and key prefixes in tests
13+
abl = "abl"
14+
hel = "hel"
15+
16+
[files]
17+
extend-exclude = [
18+
".git/",
19+
"CHANGELOG.md", # historical release notes
20+
"checkouts/", # third-party submodules
21+
]

‎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 = [

‎tests/integrations/aiohttp/test_aiohttp.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ async def hello(request):
376376

377377
@pytest.mark.tests_internal_exceptions
378378
@pytest.mark.asyncio
379-
async def test_tracing_unparseable_url(sentry_init, aiohttp_client, capture_events):
379+
async def test_tracing_unparsable_url(sentry_init, aiohttp_client, capture_events):
380380
sentry_init(integrations=[AioHttpIntegration()], traces_sample_rate=1.0)
381381

382382
async def hello(request):
@@ -400,7 +400,7 @@ async def hello(request):
400400
assert event["type"] == "transaction"
401401
assert (
402402
event["transaction"]
403-
== "tests.integrations.aiohttp.test_aiohttp.test_tracing_unparseable_url.<locals>.hello"
403+
== "tests.integrations.aiohttp.test_aiohttp.test_tracing_unparsable_url.<locals>.hello"
404404
)
405405

406406

‎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)