From ff349877844a48efaf82e68fb243d142f549bb3c Mon Sep 17 00:00:00 2001 From: Ben Vincent Date: Sun, 17 May 2026 11:40:59 +1000 Subject: [PATCH] refactor: use make test in pre-commit hook --- .pre-commit-config.yaml | 2 +- Makefile | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7460332..c0e8e3c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -35,7 +35,7 @@ repos: hooks: - id: pytest name: Run unit tests - entry: bash -c 'uv run --group dev pytest tests/ -q; rc=$?; [ $rc -eq 5 ] && exit 0 || exit $rc' + entry: make test language: system types: [python] pass_filenames: false diff --git a/Makefile b/Makefile index 70ee592..bc97295 100644 --- a/Makefile +++ b/Makefile @@ -11,7 +11,7 @@ DISTRO ?= almalinux/el9 PACKAGES := $(shell find $(ROOT_DIR)/rpms -mindepth 1 -maxdepth 1 -type d -exec test -f {}/metadata.yaml \; -print | xargs -n1 basename | sort) # Default target to build all packages -.PHONY: all list build clean +.PHONY: all list build clean test all: build-all # List all available packages @@ -47,6 +47,10 @@ dry-run: @echo "Dry run - showing what would be built for distro $(DISTRO):" $(BUILD_TOOL) build-all --distro $(DISTRO) --dry-run +# Run unit tests +test: + @uv run --group dev pytest tests/ -q; rc=$$?; [ $$rc -eq 5 ] && exit 0 || exit $$rc + # Clean target clean: @echo "Cleaning build artifacts..."