Skip to content

Commit ec85a92

Browse files
authored
Merge pull request #320 from bgilbert/pre-commit
pre-commit: add codespell; update versions
2 parents 3ac147e + 3e48604 commit ec85a92

File tree

4 files changed

+23
-9
lines changed

4 files changed

+23
-9
lines changed

.pre-commit-config.yaml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,20 @@ repos:
1616
- id: trailing-whitespace
1717

1818
- repo: https://github.com/asottile/pyupgrade
19-
rev: v3.19.0
19+
rev: v3.19.1
2020
hooks:
2121
- id: pyupgrade
2222
name: Modernize python code
2323
args: ["--py38-plus"]
2424

2525
- repo: https://github.com/PyCQA/isort
26-
rev: 5.13.2
26+
rev: 6.0.1
2727
hooks:
2828
- id: isort
2929
name: Reorder python imports with isort
3030

3131
- repo: https://github.com/psf/black
32-
rev: 24.10.0
32+
rev: 25.1.0
3333
hooks:
3434
- id: black
3535
name: Format python code with black
@@ -47,14 +47,14 @@ repos:
4747
additional_dependencies: [flake8-bugbear, Flake8-pyproject]
4848

4949
- repo: https://github.com/PyCQA/flake8
50-
rev: 7.1.1
50+
rev: 7.2.0
5151
hooks:
5252
- id: flake8
5353
name: Lint python code with flake8
5454
additional_dependencies: [flake8-bugbear, Flake8-pyproject]
5555

5656
- repo: https://github.com/pre-commit/mirrors-mypy
57-
rev: v1.13.0
57+
rev: v1.15.0
5858
hooks:
5959
- id: mypy
6060
name: Check Python types
@@ -67,6 +67,14 @@ repos:
6767
name: Validate reStructuredText syntax
6868
additional_dependencies: [sphinx, toml]
6969

70+
- repo: https://github.com/codespell-project/codespell
71+
rev: v2.4.1
72+
hooks:
73+
- id: codespell
74+
name: Check spelling with codespell
75+
additional_dependencies:
76+
- tomli # Python < 3.11
77+
7078
- repo: meta
7179
hooks:
7280
- id: check-hooks-apply

openslide/deepzoom.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,10 +263,10 @@ def _z_from_t(self, t: int) -> int:
263263

264264
@staticmethod
265265
def _pairs_from_n_tuples(
266-
tuples: tuple[tuple[int, ...], ...]
266+
tuples: tuple[tuple[int, ...], ...],
267267
) -> tuple[tuple[int, int], ...]:
268268
def all_pairs(
269-
tuples: tuple[tuple[int, ...], ...]
269+
tuples: tuple[tuple[int, ...], ...],
270270
) -> TypeGuard[tuple[tuple[int, int], ...]]:
271271
return all(len(t) == 2 for t in tuples)
272272

openslide/lowlevel.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ def __call__(self, *_args: Any) -> Any:
322322
class _Func(Protocol[_P, _T]):
323323
available: bool
324324

325-
def __call__(self, *args: _P.args) -> _T: ...
325+
def __call__(self, *args: _P.args) -> _T: ... # type: ignore[valid-type]
326326

327327
class _CTypesFunc(_Func[_P, _T]):
328328
restype: type | None
@@ -358,7 +358,7 @@ def _func(
358358

359359

360360
def _wraps_funcs(
361-
wrapped: list[_Func[..., Any]]
361+
wrapped: list[_Func[..., Any]],
362362
) -> Callable[[Callable[_P, _T]], _Func[_P, _T]]:
363363
def decorator(fn: Callable[_P, _T]) -> _Func[_P, _T]:
364364
if TYPE_CHECKING:

pyproject.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,12 @@ openslide = ["py.typed", "*.pyi"]
5151
skip-string-normalization = true
5252
target-version = ["py38", "py39", "py310", "py311", "py312", "py313"]
5353

54+
# Ref: https://github.com/codespell-project/codespell#using-a-config-file
55+
[tool.codespell]
56+
check-hidden = true
57+
# ignore-regex = ""
58+
# ignore-words-list = ""
59+
5460
# https://black.readthedocs.io/en/stable/guides/using_black_with_other_tools.html#flake8
5561
# also ignore:
5662
# - E741 ambiguous variable name

0 commit comments

Comments
 (0)