summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2020-02-18 09:28:47 -0500
committerDaniel J Walsh <dwalsh@redhat.com>2020-02-18 16:59:31 -0500
commit00e9db0822bee0ffc5d646d904631950a9bd0b27 (patch)
tree82bc5e36b084effa5871385a1e2c781a746b20ca
parentc58926e54b6ce69064f71bc58733ea903ed0e4c6 (diff)
downloadpodman-00e9db0822bee0ffc5d646d904631950a9bd0b27.tar.gz
podman-00e9db0822bee0ffc5d646d904631950a9bd0b27.tar.bz2
podman-00e9db0822bee0ffc5d646d904631950a9bd0b27.zip
Add installation of pre-commit to Makefile
pre-commit is required for running certain tests by the Makefile. Adding pre-commit to install.tools allows users to easily use and test podman. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
-rw-r--r--Makefile8
1 files changed, 7 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 67e798c8d..95b5e04d3 100644
--- a/Makefile
+++ b/Makefile
@@ -151,7 +151,7 @@ endif
lint: golangci-lint
@echo "Linting vs commit '$(call err_if_empty,EPOCH_TEST_COMMIT)'"
ifeq ($(PRE_COMMIT),)
- @echo "FATAL: pre-commit was not found, check https://pre-commit.com/ about installing it." >&2
+ @echo "FATAL: pre-commit was not found, make .install.pre-commit to installing it." >&2
@exit 2
endif
$(PRE_COMMIT) run -a
@@ -562,6 +562,12 @@ endef
.install.golangci-lint: .gopathok
VERSION=1.18.0 GOBIN=$(GOBIN) sh ./hack/install_golangci.sh
+.PHONY: .install.pre-commit
+.install.pre-commit:
+ if [ -z "$(PRE_COMMIT)" ]; then \
+ python3 -m pip install --user pre-commit; \
+ fi
+
.PHONY: .install.md2man
.install.md2man: .gopathok
if [ ! -x "$(GOMD2MAN)" ]; then \