Add support for goimports as well as go fmt

Convenience targets, instead of "make lint"

Because golangci-lint is so big and slow...
pull/10295/head
Anders F Björklund 2021-01-28 11:25:33 +01:00
parent c2d824911b
commit 5e9109e492
1 changed files with 9 additions and 0 deletions

View File

@ -418,6 +418,15 @@ gofmt: ## Run go fmt and list the files differs from gofmt's
vet: ## Run go vet
@go vet $(SOURCE_PACKAGES)
.PHONY: imports
imports: ## Run goimports and modify files in place
@goimports -w $(SOURCE_DIRS)
.PHONY: goimports
goimports: ## Run goimports and list the files differs from goimport's
@goimports -l $(SOURCE_DIRS)
@test -z "`goimports -l $(SOURCE_DIRS)`"
.PHONY: golint
golint: pkg/minikube/assets/assets.go pkg/minikube/translate/translations.go ## Run golint
@golint -set_exit_status $(SOURCE_PACKAGES)