@@ -4,9 +4,11 @@ COMMIT_HASH=$(shell git describe --always --tags --long)
4
4
GO_VERSION =$(shell go version | awk '{print $$3}')
5
5
COMMIT ?= $(if $(shell git status --porcelain --untracked-files=no) ,$(COMMIT_HASH ) -dirty,$(COMMIT_HASH ) )
6
6
CONTAINER_RUNTIME := $(shell command -v podman 2> /dev/null || echo docker)
7
- PATH := bin:$(PATH )
8
7
TMPDIR := $(shell mktemp -d)
8
+ TOOLSDIR := hack/tools
9
+ PATH := bin:$(TOOLSDIR ) /bin:$(PATH )
9
10
STACKER := $(shell which stacker)
11
+ GOLINTER := $(TOOLSDIR ) /bin/golangci-lint
10
12
OS ?= linux
11
13
ARCH ?= amd64
12
14
@@ -55,11 +57,15 @@ covhtml:
55
57
cat coverage-extended.txt coverage-minimal.txt > coverage.txt
56
58
go tool cover -html=coverage.txt -o coverage.html
57
59
60
+ $(GOLINTER ) :
61
+ mkdir -p $(TOOLSDIR ) /bin
62
+ curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(TOOLSDIR ) /bin v1.43.0
63
+ $(GOLINTER ) version
64
+
58
65
.PHONY : check
59
- check : ./golangcilint.yaml
60
- golangci-lint --version || curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s v1.26.0
61
- golangci-lint --config ./golangcilint.yaml run --enable-all --build-tags extended,containers_image_openpgp ./...
62
- golangci-lint --config ./golangcilint.yaml run --enable-all --build-tags minimal,containers_image_openpgp ./...
66
+ check : ./golangcilint.yaml $(GOLINTER )
67
+ $(GOLINTER ) --config ./golangcilint.yaml run --enable-all --out-format=colored-line-number --build-tags minimal,containers_image_openpgp ./...
68
+ $(GOLINTER ) --config ./golangcilint.yaml run --enable-all --out-format=colored-line-number --build-tags extended,containers_image_openpgp ./...
63
69
64
70
swagger/docs.go :
65
71
swag -v || go install github.com/swaggo/swag/cmd/swag
@@ -76,6 +82,7 @@ update-licenses:
76
82
.PHONY : clean
77
83
clean :
78
84
rm -f bin/zot*
85
+ rm -rf hack
79
86
80
87
.PHONY : run
81
88
run : binary test
0 commit comments