From 00fa4f90386d147391487a0b2bc6a2a8fcc5a511 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 30 Mar 2026 18:04:14 +0000 Subject: [PATCH 1/3] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/astral-sh/ruff-pre-commit: v0.15.7 → v0.15.8](https://github.com/astral-sh/ruff-pre-commit/compare/v0.15.7...v0.15.8) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 12932b9..1e1e0cb 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -42,7 +42,7 @@ repos: {{cookiecutter.package_name}}/setup.cfg )$ - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.15.7 + rev: v0.15.8 hooks: - id: ruff args: [--fix, hooks, tests] From 7887e5033592c31da792488a1a462582ea99c370 Mon Sep 17 00:00:00 2001 From: Tobias Raabe Date: Fri, 3 Apr 2026 16:04:45 +0200 Subject: [PATCH 2/3] Fix pre-commit CI by pinning ruff-pre-commit --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1e1e0cb..12932b9 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -42,7 +42,7 @@ repos: {{cookiecutter.package_name}}/setup.cfg )$ - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.15.8 + rev: v0.15.7 hooks: - id: ruff args: [--fix, hooks, tests] From deeb6ac6516191f1b7b24b24a4c6331658d9c97d Mon Sep 17 00:00:00 2001 From: Tobias Raabe Date: Fri, 3 Apr 2026 16:29:38 +0200 Subject: [PATCH 3/3] Update ruff hooks and drop refurb --- .pre-commit-config.yaml | 12 +++--------- hooks/post_gen_project.py | 15 ++++++++++----- pyproject.toml | 2 +- 3 files changed, 14 insertions(+), 15 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 12932b9..f3d2f58 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -42,20 +42,14 @@ repos: {{cookiecutter.package_name}}/setup.cfg )$ - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.15.7 + rev: v0.15.9 hooks: - - id: ruff + - id: ruff-check args: [--fix, hooks, tests] pass_filenames: false - id: ruff-format args: [hooks, tests] pass_filenames: false -- repo: https://github.com/dosisod/refurb - rev: v2.3.0 - hooks: - - id: refurb - args: [--ignore, FURB126] - exclude: ({{cookiecutter.package_name}}) - repo: https://github.com/econchick/interrogate rev: 1.7.0 hooks: @@ -86,7 +80,7 @@ repos: additional_dependencies: [tomli] exclude: (^|/)uv\.lock$ - repo: https://github.com/pre-commit/mirrors-mypy - rev: 'v1.19.1' + rev: 'v1.20.0' hooks: - id: mypy args: [ diff --git a/hooks/post_gen_project.py b/hooks/post_gen_project.py index 0be3a6d..7e10f77 100644 --- a/hooks/post_gen_project.py +++ b/hooks/post_gen_project.py @@ -24,6 +24,11 @@ def remove_directory(*filepath: str | Path) -> None: def main() -> None: """Apply post generation hooks.""" project_path = Path.cwd() + git = shutil.which("git") + + if git is None: + msg = "Could not find 'git' on PATH." + raise RuntimeError(msg) if "{{ cookiecutter.open_source_license }}" == "Not open source": remove_file(project_path, "LICENSE") @@ -35,22 +40,22 @@ def main() -> None: remove_file(project_path, ".readthedocs.yaml") subprocess.run( - ("git", "init", "--initial-branch", "main"), check=True, capture_output=True + (git, "init", "--initial-branch", "main"), check=True, capture_output=True ) if "{{ cookiecutter.make_initial_commit }}" == "yes": # Create an initial commit on the main branch and restore global default name. subprocess.run( - ("git", "config", "user.name", "'{{ cookiecutter.github_username }}'"), + (git, "config", "user.name", "'{{ cookiecutter.github_username }}'"), check=True, ) subprocess.run( - ("git", "config", "user.email", "'{{ cookiecutter.github_email }}'"), + (git, "config", "user.email", "'{{ cookiecutter.github_email }}'"), check=True, ) - subprocess.run(("git", "add", "."), check=True) + subprocess.run((git, "add", "."), check=True) subprocess.run( - ("git", "commit", "-m", "'Initial commit.'"), + (git, "commit", "-m", "'Initial commit.'"), check=True, capture_output=True, ) diff --git a/pyproject.toml b/pyproject.toml index 833adfa..c810fd6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -109,7 +109,7 @@ extend-ignore = [ ] [tool.ruff.lint.per-file-ignores] -"hooks/post_gen_project.py" = ["PLR0133"] +"hooks/post_gen_project.py" = ["PLR0133", "S603"] "hooks/*" = ["INP001"] "tests/*" = ["D", "ANN"]