-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
27 lines (21 loc) · 860 Bytes
/
Makefile
File metadata and controls
27 lines (21 loc) · 860 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
FIND_EXCLUSIONS= \
-not \( \( -path '*/.git/*' -o -path './build/*' -o -path './vendor/*' -o -path '*/.terraform/*' \) -prune \)
GO_SRC_FILES := $(shell find . $(FIND_EXCLUSIONS) -type f -name '*.go' -not -name '*_test.go')
GO_FMT_FILES := $(shell find . $(FIND_EXCLUSIONS) -type f -name '*.go' -print0 | xargs -0 grep -E --null -L '^// Code generated .* DO NOT EDIT\.$$' | tr '\0' ' ')
default: build
build/whichtests: $(GO_SRC_FILES) go.mod go.sum
mkdir -p ./build
go build -o ./build/whichtests .
build: build/whichtests
.PHONY: build
fmt:
go mod tidy
go run golang.org/x/tools/cmd/goimports@v0.35.0 -w $(GO_FMT_FILES)
go run mvdan.cc/gofumpt@v0.8.0 -w -l $(GO_FMT_FILES)
.PHONY: fmt
lint:
go run github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.4.0 run ./...
.PHONY: lint
test:
go test -test.v -timeout 30s -cover ./...
.PHONY: test