From e492f8d1ba9f6ae8cfd937b2efd9fc5ca7f3a83d Mon Sep 17 00:00:00 2001 From: "Luke W. Johnston" Date: Wed, 21 May 2025 12:32:40 +0200 Subject: [PATCH 1/2] build: :hammer: add a "install pre-commit" justfile recipe --- justfile | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/justfile b/justfile index 24b6613..09af2dd 100644 --- a/justfile +++ b/justfile @@ -2,7 +2,14 @@ just --list --unsorted # Run all build-related recipes in the justfile -run-all: install-deps format-python check-python check-unused test-python check-security check-spelling check-commits build-website +run-all: install-deps install-precommit format-python check-python check-unused test-python check-security check-spelling check-commits build-website + +# Install the pre-commit hooks +install-precommit: + # Install pre-commit hooks + uvx pre-commit install + # Update versions of pre-commit hooks + uvx pre-commit autoupdate # Install Python package dependencies install-deps: @@ -73,4 +80,5 @@ check-unused: # - 100 %: function/method/class argument, unreachable code # - 90 %: import # - 60 %: attribute, class, function, method, property, variable - uv run vulture src/ tests/ + # Create an allowlist with `vulture --make-allowlist` + uv run vulture src/ tests/ **/vulture-allowlist.py From 49abc6e5f48db981096879346de4436771dedf02 Mon Sep 17 00:00:00 2001 From: "Luke W. Johnston" Date: Wed, 21 May 2025 21:36:52 +0200 Subject: [PATCH 2/2] build: :hammer: don't install pre-commit hooks when running `run-all` --- justfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/justfile b/justfile index 09af2dd..0f4c749 100644 --- a/justfile +++ b/justfile @@ -2,12 +2,14 @@ just --list --unsorted # Run all build-related recipes in the justfile -run-all: install-deps install-precommit format-python check-python check-unused test-python check-security check-spelling check-commits build-website +run-all: install-deps format-python check-python check-unused test-python check-security check-spelling check-commits build-website # Install the pre-commit hooks install-precommit: # Install pre-commit hooks uvx pre-commit install + # Run pre-commit hooks on all files + uvx pre-commit run --all-files # Update versions of pre-commit hooks uvx pre-commit autoupdate