summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-01-15 23:51:22 +0100
committerGitHub <noreply@github.com>2020-01-15 23:51:22 +0100
commite1e405b70d687897423d0d1c327efd9bea190dff (patch)
treed2abce1febe1bf7f2c2a8d741f0c4010d4cf5e2b /Makefile
parent741e29caf39c57551724a48265f6d9641f8f6fe0 (diff)
parente9cd3319cf14b3d9484c4e6d7aa5040509a81653 (diff)
downloadpodman-e1e405b70d687897423d0d1c327efd9bea190dff.tar.gz
podman-e1e405b70d687897423d0d1c327efd9bea190dff.tar.bz2
podman-e1e405b70d687897423d0d1c327efd9bea190dff.zip
Merge pull request #4807 from ssbarnea/fix/pre-commit
Enable pre-commit linting
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile9
1 files changed, 8 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index a02706eaf..62ed1e21f 100644
--- a/Makefile
+++ b/Makefile
@@ -32,8 +32,10 @@ BUILDTAGS ?= \
exclude_graphdriver_devicemapper \
seccomp \
varlink
-PYTHON ?= $(shell command -v python python3|head -n1)
+PYTHON ?= $(shell command -v python3 python|head -n1)
PKG_MANAGER ?= $(shell command -v dnf yum|head -n1)
+# ~/.local/bin is not in PATH on all systems
+PRE_COMMIT = $(shell command -v bin/venv/bin/pre-commit ~/.local/bin/pre-commit pre-commit | head -n1)
SOURCES = $(shell find . -name "*.go")
@@ -149,6 +151,11 @@ endif
touch $@
lint: golangci-lint
+ifeq ($(PRE_COMMIT),)
+ @echo "FATAL: pre-commit was not found, check https://pre-commit.com/ about installing it." >&2
+ @exit 2
+endif
+ $(PRE_COMMIT) run -a
golangci-lint: .gopathok varlink_generate .install.golangci-lint
$(GOBIN)/golangci-lint run