From 7890721e611fa71f3df4812f17daab64cc5fe632 Mon Sep 17 00:00:00 2001 From: Jens Troeger Date: Wed, 29 Jul 2026 10:37:55 -0700 Subject: [PATCH 1/2] refactor: move from pre-commit for git hook management to prek --- Makefile | 12 ++++++------ pyproject.toml | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index cd1830ad..087beec9 100644 --- a/Makefile +++ b/Makefile @@ -100,7 +100,7 @@ venv: # See https://packaging.python.org/en/latest/tutorials/packaging-projects/#generating-distribution-archives. .PHONY: setup setup: force-upgrade - python -m pre_commit install + python -m prek install mkdir -p dist # Install or upgrade an existing virtual environment based on the @@ -167,15 +167,15 @@ audit: .PHONY: check check-code check-ruff check-lint check-mypy check-actionlint check-code: check-ruff check-lint check-mypy check-actionlint check-ruff: - python -m pre_commit run ruff --all-files + python -m prek run ruff --all-files check-lint: - python -m pre_commit run pylint --all-files + python -m prek run pylint --all-files check-mypy: - python -m pre_commit run mypy --all-files + python -m prek run mypy --all-files check-actionlint: - python -m pre_commit run actionlint --all-files + python -m prek run actionlint --all-files check: - python -m pre_commit run --all-files + python -m prek run --all-files # Run different kinds of tests: unit tests, integration tests, performance tests. # Note that the default goal 'test' runs the unit tests only, mainly for convenience diff --git a/pyproject.toml b/pyproject.toml index 134c9ed9..88bcae1d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -93,7 +93,7 @@ dist = [ "flit >=3.2.0,<4.0.0", ] hooks = [ - "pre-commit >=4.0.0,<4.7.0", + "prek >=0.4.0,<0.5.0", ] From 0f8f3c700c671d9b4c288fb3e0025cd3bba40635 Mon Sep 17 00:00:00 2001 From: Jens Troeger Date: Mon, 3 Aug 2026 22:04:06 -0700 Subject: [PATCH 2/2] chore: adjust .pre-commit-config.yaml for `prek` --- .pre-commit-config.yaml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9d160529..906373a7 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -55,27 +55,28 @@ repos: args: [--config-file, pyproject.toml] # Enable a whole bunch of useful helper hooks, too. -# See https://pre-commit.com/hooks.html for more hooks. -- repo: https://github.com/pre-commit/pre-commit-hooks - rev: 3e8a8703264a2f4a69428a0aa4dcb512790b2c8c # frozen: v6.0.0 +# See https://prek.j178.dev/builtin +- repo: builtin hooks: - - id: check-ast + # missing - id: check-ast - id: check-case-conflict - id: check-merge-conflict - id: check-added-large-files stages: [pre-commit] args: [--maxkb=500] - - id: debug-statements + # issing - id: debug-statements - id: end-of-file-fixer stages: [pre-commit] - id: trailing-whitespace args: [--markdown-linebreak-ext=md] stages: [pre-commit] - id: detect-private-key - - id: detect-aws-credentials - args: [--allow-missing-credentials] + # missing - id: detect-aws-credentials + # args: [--allow-missing-credentials] - id: check-yaml - id: check-toml +# https://github.com/j178/prek/issues/38 +# https://github.com/j178/prek/issues/2355 - repo: https://github.com/pre-commit/pygrep-hooks rev: 3a6eb0fadf60b3cccfd80bad9dbb6fae7e47b316 # frozen: v1.10.0 hooks: