-
-
Notifications
You must be signed in to change notification settings - Fork 128
Expand file tree
/
Copy pathMakefile
More file actions
81 lines (60 loc) · 2.07 KB
/
Copy pathMakefile
File metadata and controls
81 lines (60 loc) · 2.07 KB
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
default: ci
ci: lint cover
ci-full: ci dependencies-analyze openapi-check check-all-modules lint-markdown bench
PATHS := ./... ./examples/petstore/... $\
./extra/fuegogin/... ./examples/gin-compat/... $\
./extra/sql/... ./extra/sqlite3/... $\
./extra/fuegoecho/... ./examples/echo-compat/... $\
./extra/fuegomux/... ./examples/mux-compat/...
test:
go test $(PATHS)
cover:
go test -coverprofile=coverage.out ${PATHS}
go tool cover -func=coverage.out
check-all-modules:
./check-all-modules.sh
cover-web: cover
go tool cover -html=coverage.out
bench:
go test -bench ./... -benchmem
build:
go build -v ./... ./examples/petstore/...
dependencies-analyze:
which govulncheck || go install golang.org/x/vuln/cmd/govulncheck@latest
govulncheck ./...
fmt:
which gofumpt || go install mvdan.cc/gofumpt@latest
gofumpt -l -w -extra .
FIX := "--fix"
GOLANGCI_LINT_VERSION = v2.7.1
lint:
which golangci-lint || go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@$(GOLANGCI_LINT_VERSION)
golangci-lint run ${FIX} ./...
lint-markdown:
markdownlint ${FIX} --ignore documentation/node_modules --dot .
# Update golden files
golden-update:
(cd examples/petstore/lib && go test -update)
# Check OpenAPI spec generated for the Petstore example. Uses https://github.com/daveshanley/vacuum
openapi-check:
vacuum lint -d examples/petstore/lib/testdata/doc/openapi.json
# Examples
example:
( cd examples/full-app-gourmet && go run . -debug )
example-watch:
( cd examples/full-app-gourmet && air -- -debug )
petstore:
( cd examples/petstore && go run . -debug )
# Documentation website
docs:
go run golang.org/x/pkgsite/cmd/pkgsite@latest -http localhost:8084
docs-open:
go run golang.org/x/pkgsite/cmd/pkgsite@latest -http localhost:8084 -open
release:
ifndef VERSION
$(error VERSION is required. Usage: make release VERSION=vX.Y.Z)
endif
./scripts/tag-release.sh $(VERSION)
.PHONY: docs-open docs example-watch example lint lint-markdown fmt ci ci-full
.PHONY: dependencies-analyze build bench cover-web cover test petstore check-all-modules
.PHONY: golden-update openapi-check release