Skip to content

Commit a60a2a0

Browse files
authored
Merge pull request #3166 from CoolCat467/crate-ci-typos
Add spellchecking with `crate-ci/typos`
2 parents 52600ed + 45b386d commit a60a2a0

File tree

10 files changed

+28
-12
lines changed

10 files changed

+28
-12
lines changed

.pre-commit-config.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ repos:
3434
rev: v2.3.0
3535
hooks:
3636
- id: codespell
37+
- repo: https://github.com/crate-ci/typos
38+
rev: v1.28.4
39+
hooks:
40+
- id: typos
3741
- repo: https://github.com/sphinx-contrib/sphinx-lint
3842
rev: v1.0.0
3943
hooks:

newsfragments/3166.breaking.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fixed spelling error in Windows CFFI ErrorCodes Enum ``ERROR_INVALID_PARAMETER``

pyproject.toml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,19 @@ force-exclude = '''
8484
[tool.codespell]
8585
ignore-words-list = 'astroid,crasher,asend'
8686

87+
[tool.typos]
88+
default.extend-ignore-re = [
89+
"(?Rm)^.*(#|//)\\s*spellchecker:disable-line$",
90+
]
91+
92+
[tool.typos.default.extend-identifiers]
93+
IPPROTO_ND = "IPPROTO_ND"
94+
95+
[tool.typos.default.extend-words]
96+
astroid = "astroid"
97+
crasher = "crasher"
98+
asend = "asend"
99+
87100
[tool.ruff]
88101
respect-gitignore = true
89102
fix = true

src/trio/_abc.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -192,9 +192,7 @@ async def getaddrinfo(
192192
Any required IDNA encoding is handled before calling this function;
193193
your implementation can assume that it will never see U-labels like
194194
``"café.com"``, and only needs to handle A-labels like
195-
``b"xn--caf-dma.com"``.
196-
197-
"""
195+
``b"xn--caf-dma.com"``.""" # spellchecker:disable-line
198196

199197
@abstractmethod
200198
async def getnameinfo(

src/trio/_core/_ki.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ def remove(
136136
) -> None:
137137
self = selfref()
138138
if self is not None:
139-
try: # noqa: SIM105 # supressible-exception
139+
try: # noqa: SIM105 # suppressible-exception
140140
del self._data[k]
141141
except KeyError:
142142
pass

src/trio/_core/_parking_lot.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# ParkingLot provides an abstraction for a fair waitqueue with cancellation
2-
# and requeueing support. Inspiration:
2+
# and requeuing support. Inspiration:
33
#
44
# https://webkit.org/blog/6161/locking-in-webkit/
55
# https://amanieu.github.io/parking_lot/
@@ -136,7 +136,7 @@ class ParkingLotStatistics:
136136
@final
137137
@attrs.define(eq=False)
138138
class ParkingLot:
139-
"""A fair wait queue with cancellation and requeueing.
139+
"""A fair wait queue with cancellation and requeuing.
140140
141141
This class encapsulates the tricky parts of implementing a wait
142142
queue. It's useful for implementing higher-level synchronization

src/trio/_core/_run.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ class CancelStatus:
348348
# become effectively cancelled when they do, unless scope.shield
349349
# is True. May be None (for the outermost CancelStatus in a call
350350
# to trio.run(), briefly during TaskStatus.started(), or during
351-
# recovery from mis-nesting of cancel scopes).
351+
# recovery from misnesting of cancel scopes).
352352
_parent: CancelStatus | None = attrs.field(default=None, repr=False, alias="parent")
353353

354354
# All of the CancelStatuses that have this CancelStatus as their parent.
@@ -362,7 +362,7 @@ class CancelStatus:
362362

363363
# Set to True on still-active cancel statuses that are children
364364
# of a cancel status that's been closed. This is used to permit
365-
# recovery from mis-nested cancel scopes (well, at least enough
365+
# recovery from misnested cancel scopes (well, at least enough
366366
# recovery to show a useful traceback).
367367
abandoned_by_misnesting: bool = attrs.field(default=False, init=False, repr=False)
368368

@@ -595,7 +595,7 @@ def _close(self, exc: BaseException | None) -> BaseException | None:
595595
return new_exc
596596
scope_task = current_task()
597597
if scope_task._cancel_status is not self._cancel_status:
598-
# Cancel scope mis-nesting: this cancel scope isn't the most
598+
# Cancel scope misnesting: this cancel scope isn't the most
599599
# recently opened by this task (that's still open). That is,
600600
# our assumptions about context managers forming a stack
601601
# have been violated. Try and make the best of it.

src/trio/_core/_windows_cffi.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ class ErrorCodes(enum.IntEnum):
420420
ERROR_OPERATION_ABORTED = 995
421421
ERROR_ABANDONED_WAIT_0 = 735
422422
ERROR_INVALID_HANDLE = 6
423-
ERROR_INVALID_PARMETER = 87
423+
ERROR_INVALID_PARAMETER = 87
424424
ERROR_NOT_FOUND = 1168
425425
ERROR_NOT_SOCKET = 10038
426426

src/trio/_tests/test_threads.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -852,7 +852,7 @@ async def async_back_in_main() -> tuple[str, str]:
852852
assert sniffio.current_async_library() == "trio"
853853

854854

855-
def test_run_fn_as_system_task_catched_badly_typed_token() -> None:
855+
def test_run_fn_as_system_task_caught_badly_typed_token() -> None:
856856
with pytest.raises(RuntimeError):
857857
from_thread_run_sync(
858858
_core.current_time,

src/trio/_util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ def fix_one(qualname: str, name: str, obj: object) -> None:
234234
# so don't bother.
235235
class generic_function(Generic[RetT]):
236236
"""Decorator that makes a function indexable, to communicate
237-
non-inferrable generic type parameters to a static type checker.
237+
non-inferable generic type parameters to a static type checker.
238238
239239
If you write::
240240

0 commit comments

Comments
 (0)