Merge pull request #4557 from afbjorklund/golint

Add golint and gocyclo smaller make targets
pull/4573/head
Anders Björklund 2019-06-24 08:18:43 +02:00 committed by GitHub
commit c7ea856d2a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 15 additions and 2 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)
@ -217,12 +217,25 @@ gendocs: out/docs/minikube.md
.PHONY: fmt
fmt:
@gofmt -l -s -w $(SOURCE_DIRS)
@gofmt -s -w $(SOURCE_DIRS)
.PHONY: gofmt
gofmt:
@gofmt -s -l $(SOURCE_DIRS)
@test -z "`gofmt -s -l $(SOURCE_DIRS)`"
.PHONY: vet
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)