-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
51 lines (41 loc) · 958 Bytes
/
Makefile
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
TARGET=main
PACKAGE_PATH=.
.PHONY: setup
setup:
go mod tidy
.PHONY: build
build:
go build -o ${TARGET} ${PACKAGE_PATH}
.PHONY: run
run: build
./${TARGET}
.PHONY: clean
clean:
go clean
.PHONY: test
test:
go test ./...
.PHONY: lint
lint:
golangci-lint run --enable-all
.PHONE: deps
deps:
go install github.com/golangci/golangci-lint/cmd/[email protected]
go install github.com/cosmtrek/air@latest
.PHONY: up
up: build
air --build.cmd "make build" --build.bin "./${TARGET}" --build.delay "100" \
--build.exclude_dir "" \
--build.include_ext "go, tpl, tmpl, html, css, scss, js, ts, sql, jpeg, jpg, gif, png, bmp, svg, webp, ico" \
--misc.clean_on_exit "true"
.PHONY: tidy
tidy:
go fmt ./...
go mod tidy -v
.PHONY: audit
audit:
go mod verify
go vet ./...
go run honnef.co/go/tools/cmd/staticcheck@latest -checks=all,-ST1000,-U1000 ./...
go run golang.org/x/vuln/cmd/govulncheck@latest ./...
go test -race -buildvcs -vet=off ./...