mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-05-17 10:15:22 +00:00
The lint task was failing at head, due to a nolint:exhaustive error directive that golangci nolintlint believes is unused. Issue seems to be https://github.com/golangci/golangci-lint/issues/3228 and seems to be a bug in golang-ci / nolintlint, using the workaround proposed in https://github.com/golangci/golangci-lint/issues/1940 which is to clear the cache between runs.
40 lines
903 B
Makefile
40 lines
903 B
Makefile
# Copyright 2022 The Kubernetes Authors.
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
MYGOBIN = $(shell go env GOBIN)
|
|
ifeq ($(MYGOBIN),)
|
|
MYGOBIN = $(shell go env GOPATH)/bin
|
|
endif
|
|
export PATH := $(MYGOBIN):$(PATH)
|
|
|
|
# only set this if not already set, so importing makefiles can override it
|
|
export KUSTOMIZE_ROOT ?= $(shell pwd | sed -E 's|(.*\/kustomize)/(.*)|\1|')
|
|
include $(KUSTOMIZE_ROOT)/Makefile-tools.mk
|
|
|
|
.PHONY: lint test fix fmt tidy vet build
|
|
|
|
lint: $(MYGOBIN)/golangci-lint
|
|
$(MYGOBIN)/golangci-lint cache clean # Workaround for https://github.com/golangci/golangci-lint/issues/3228
|
|
$(MYGOBIN)/golangci-lint \
|
|
-c $$KUSTOMIZE_ROOT/.golangci.yml \
|
|
--path-prefix $(shell pwd | sed -E 's|(.*\/kustomize)/(.*)|\2|') \
|
|
run ./...
|
|
|
|
test:
|
|
go test -v -timeout 45m -cover ./...
|
|
|
|
fix:
|
|
go fix ./...
|
|
|
|
fmt:
|
|
go fmt ./...
|
|
|
|
tidy:
|
|
go mod tidy
|
|
|
|
vet:
|
|
go vet ./...
|
|
|
|
build:
|
|
go build -v -o $(MYGOBIN) ./...
|