Skip to content

Commit

Permalink
Refactor into ensure-pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
hugovk committed Jun 2, 2024
1 parent 116dbef commit de0820d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Doc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit de0820d

Please sign in to comment.