diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-01-15 23:51:22 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-15 23:51:22 +0100 |
commit | e1e405b70d687897423d0d1c327efd9bea190dff (patch) | |
tree | d2abce1febe1bf7f2c2a8d741f0c4010d4cf5e2b /Makefile | |
parent | 741e29caf39c57551724a48265f6d9641f8f6fe0 (diff) | |
parent | e9cd3319cf14b3d9484c4e6d7aa5040509a81653 (diff) | |
download | podman-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-- | Makefile | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -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 |