Add golint and gocyclo smaller make targets

Also fix the broken fmt and reportcard ones:

Recursive variable 'SOURCE_DIRS' references itself (eventually).
pull/4557/head
Anders F Björklund 2019-06-22 14:34:18 +02:00
parent 247efdea15
commit cc0a1298d9
1 changed files with 9 additions and 1 deletions

View File

@ -76,7 +76,7 @@ MINIKUBE_BUILD_TAGS := container_image_ostree_stub containers_image_openpgp
MINIKUBE_INTEGRATION_BUILD_TAGS := integration $(MINIKUBE_BUILD_TAGS)
CMD_SOURCE_DIRS = cmd pkg
SOURCE_DIRS = $(SOURCE_DIRS) test
SOURCE_DIRS = $(CMD_SOURCE_DIRS) test
SOURCE_PACKAGES = ./cmd/... ./pkg/... ./test/...
# $(call DOCKER, image, command)
@ -223,6 +223,14 @@ fmt:
vet:
@go vet $(SOURCE_PACKAGES)
.PHONY: golint
golint:
@golint -set_exit_status $(SOURCE_PACKAGES)
.PHONY: gocyclo
gocyclo:
@gocyclo -over 15 `find $(SOURCE_DIRS) -type f -name "*.go"`
out/linters/golangci-lint:
mkdir -p out/linters
curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b out/linters $(GOLINT_VERSION)