From e15576cc73b195716b7f57b81a55b1ee7679e700 Mon Sep 17 00:00:00 2001 From: Benjamin Gilbert Date: Mon, 14 Apr 2025 12:02:51 -0500 Subject: [PATCH 1/2] pre-commit: add codespell Signed-off-by: Benjamin Gilbert --- .pre-commit-config.yaml | 6 ++++++ pyproject.toml | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a1d86a6..f26c411 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -58,6 +58,12 @@ repos: - types-PyYAML - types-requests + - repo: https://github.com/codespell-project/codespell + rev: v2.4.1 + hooks: + - id: codespell + name: Check spelling with codespell + - repo: meta hooks: - id: check-hooks-apply diff --git a/pyproject.toml b/pyproject.toml index c0c13ba..5409b38 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,6 +3,12 @@ line-length = 79 skip-string-normalization = true target-version = ["py313"] +# Ref: https://github.com/codespell-project/codespell#using-a-config-file +[tool.codespell] +check-hidden = true +# ignore-regex = "" +ignore-words-list = "subtile" + # https://black.readthedocs.io/en/stable/guides/using_black_with_other_tools.html#flake8 # requires Flake8-pyproject [tool.flake8] From 8d2cd24a65f7620e2660492a17d41081bfa52e85 Mon Sep 17 00:00:00 2001 From: Benjamin Gilbert Date: Mon, 14 Apr 2025 12:06:16 -0500 Subject: [PATCH 2/2] pre-commit: update versions Signed-off-by: Benjamin Gilbert --- .pre-commit-config.yaml | 10 +++++----- demo/_synctiles.py | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f26c411..7316f2d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -15,20 +15,20 @@ repos: - id: trailing-whitespace - repo: https://github.com/asottile/pyupgrade - rev: v3.19.0 + rev: v3.19.1 hooks: - id: pyupgrade name: Modernize Python code args: ["--py313-plus"] - repo: https://github.com/PyCQA/isort - rev: 5.13.2 + rev: 6.0.1 hooks: - id: isort name: Reorder Python imports with isort - repo: https://github.com/psf/black - rev: 24.10.0 + rev: 25.1.0 hooks: - id: black name: Format Python code with black @@ -40,14 +40,14 @@ repos: additional_dependencies: [flake8-bugbear, Flake8-pyproject] - repo: https://github.com/PyCQA/flake8 - rev: 7.1.1 + rev: 7.2.0 hooks: - id: flake8 name: Lint Python code with flake8 additional_dependencies: [flake8-bugbear, Flake8-pyproject] - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.13.0 + rev: v1.15.0 hooks: - id: mypy name: Check Python types diff --git a/demo/_synctiles.py b/demo/_synctiles.py index 7b2fc01..30fed0f 100755 --- a/demo/_synctiles.py +++ b/demo/_synctiles.py @@ -744,7 +744,7 @@ def finish_retile(ctxfile: TextIO, summarydir: Path) -> None: if __name__ == '__main__': - cpu_count = os.process_cpu_count() # type: ignore[attr-defined] + cpu_count = os.process_cpu_count() parser = ArgumentParser() subparsers = parser.add_subparsers(metavar='subcommand', required=True)