Skip to content

Commit e37af1e

Browse files
committed
chore: also use typos
Signed-off-by: Henry Schreiner <[email protected]>
1 parent 228f563 commit e37af1e

File tree

7 files changed

+39
-9
lines changed

7 files changed

+39
-9
lines changed

.github/CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ The valid options are:
165165
* Use `cmake --build build -j12` to build with 12 cores (for example).
166166
* Use `-G` and the name of a generator to use something different. `cmake
167167
--help` lists the generators available.
168-
- On Unix, setting `CMAKE_GENERATER=Ninja` in your environment will give
168+
- On Unix, setting `CMAKE_GENERATOR=Ninja` in your environment will give
169169
you automatic multithreading on all your CMake projects!
170170
* Open the `CMakeLists.txt` with QtCreator to generate for that IDE.
171171
* You can use `-DCMAKE_EXPORT_COMPILE_COMMANDS=ON` to generate the `.json` file

.pre-commit-config.yaml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,16 @@ repos:
115115
rev: "v2.4.1"
116116
hooks:
117117
- id: codespell
118-
exclude: ".supp$"
118+
exclude: "(.supp|^pyproject.toml)$"
119119
args: ["-x.codespell-ignore-lines", "-Lccompiler,intstruct"]
120120

121+
# Also check spelling
122+
- repo: https://github.com/crate-ci/typos
123+
rev: v1.40.0
124+
hooks:
125+
- id: typos
126+
args: []
127+
121128
# Check for common shell mistakes
122129
- repo: https://github.com/shellcheck-py/shellcheck-py
123130
rev: "v0.11.0.1"

docs/advanced/embedding.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ Activating a Sub-interpreter
302302

303303
Once a sub-interpreter is created, you can "activate" it on a thread (and
304304
acquire its GIL) by creating a :class:`subinterpreter_scoped_activate`
305-
instance and passing it the sub-intepreter to be activated. The function
305+
instance and passing it the sub-interpreter to be activated. The function
306306
will acquire the sub-interpreter's GIL and make the sub-interpreter the
307307
current active interpreter on the current thread for the lifetime of the
308308
instance. When the :class:`subinterpreter_scoped_activate` instance goes out

docs/changelog.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ New Features:
167167
[#5665](https://github.com/pybind/pybind11/pull/5665) and consolidate code
168168
[#5670](https://github.com/pybind/pybind11/pull/5670).
169169

170-
- Added API in `pybind11/subinterpreter.h` for embedding sub-intepreters (requires Python 3.12+).
170+
- Added API in `pybind11/subinterpreter.h` for embedding sub-interpreters (requires Python 3.12+).
171171
[#5666](https://github.com/pybind/pybind11/pull/5666)
172172

173173
- `py::native_enum` was added, for conversions between Python's native
@@ -1213,7 +1213,7 @@ Performance and style:
12131213
- Optimize Eigen sparse matrix casting by removing unnecessary
12141214
temporary. [#4064](https://github.com/pybind/pybind11/pull/4064)
12151215
- Avoid potential implicit copy/assignment constructors causing double
1216-
free in `strdup_gaurd`.
1216+
free in `strdup_guard`.
12171217
[#3905](https://github.com/pybind/pybind11/pull/3905)
12181218
- Enable clang-tidy checks `misc-definitions-in-headers`,
12191219
`modernize-loop-convert`, and `modernize-use-nullptr`.

pyproject.toml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,3 +184,26 @@ isort.required-imports = ["from __future__ import annotations"]
184184

185185
[tool.repo-review]
186186
ignore = ["PP"]
187+
188+
[tool.typos]
189+
files.extend-exclude = ["/cpython"]
190+
191+
[tool.typos.default.extend-identifiers]
192+
ser_no = "ser_no"
193+
SerNo = "SerNo"
194+
StrLits = "StrLits"
195+
196+
[tool.typos.default.extend-words]
197+
nd = "nd"
198+
valu = "valu"
199+
fo = "fo"
200+
quater = "quater"
201+
optin = "optin"
202+
othr = "othr"
203+
204+
#[tool.typos.type.cpp.extend-words]
205+
setp = "setp"
206+
ot = "ot"
207+
208+
[tool.typos.type.json.extend-words]
209+
ba = "ba"

tests/conftest.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -304,10 +304,10 @@ def backport_typehints() -> Callable[[SanitizedString], SanitizedString]:
304304
if sys.version_info < (3, 10):
305305
d["typing_extensions.TypeGuard"] = "typing.TypeGuard"
306306

307-
def backport(sanatized_string: SanitizedString) -> SanitizedString:
307+
def backport(sanitized_string: SanitizedString) -> SanitizedString:
308308
for old, new in d.items():
309-
sanatized_string.string = sanatized_string.string.replace(old, new)
309+
sanitized_string.string = sanitized_string.string.replace(old, new)
310310

311-
return sanatized_string
311+
return sanitized_string
312312

313313
return backport

tests/test_docstring_options.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def test_docstring_options():
4848
assert not m.DocstringTestFoo.__doc__
4949
assert not m.DocstringTestFoo.value_prop.__doc__
5050

51-
# Check existig behaviour of enum docstings
51+
# Check existing behaviour of enum docstings
5252
assert (
5353
m.DocstringTestEnum1.__doc__
5454
== "Enum docstring\n\nMembers:\n\n Member1\n\n Member2"

0 commit comments

Comments
 (0)