From de0820d3e07d7ee69eefaa4c4422ff6c58b1445f Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Wed, 29 May 2024 18:19:26 +0300 Subject: [PATCH] Refactor into ensure-pre-commit --- Doc/Makefile | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Doc/Makefile b/Doc/Makefile index d7b520c4f6f675..50f909c172d29d 100644 --- a/Doc/Makefile +++ b/Doc/Makefile @@ -244,13 +244,16 @@ dist: rm -r dist/python-$(DISTVERSION)-docs-texinfo rm dist/python-$(DISTVERSION)-docs-texinfo.tar -.PHONY: check -check: venv +.PHONY: ensure-pre-commit +ensure-pre-commit: venv if uv --version > /dev/null; then \ $(VENVDIR)/bin/python3 -m pre_commit --version > /dev/null || VIRTUAL_ENV=$(VENVDIR) uv pip install pre-commit; \ else \ $(VENVDIR)/bin/python3 -m pre_commit --version > /dev/null || $(VENVDIR)/bin/python3 -m pip install pre-commit; \ - fi; + fi + +.PHONY: check +check: ensure-pre-commit $(VENVDIR)/bin/python3 -m pre_commit run --all-files .PHONY: serve