-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathMakefile
More file actions
88 lines (63 loc) · 1.58 KB
/
Copy pathMakefile
File metadata and controls
88 lines (63 loc) · 1.58 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
82
83
84
85
86
87
88
-include .env.local
export
PKG ?= ./...
AIR_VERSION = v1.65.1
SQLC_VERSION = v1.30.0
GOOSE_VERSION = v3.27.0
NILAWAY_VERSION = v0.0.0-20260213150243-937701de96c7
GOTESTSUM_VERSION = v1.13.0
GOLANGCI_LINT_VERSION = v2.13.1
dev:
APP_ENV=development air
build:
go build -o ./tmp/main.exe ./cmd/api/main.go
start: build
APP_ENV=production ./tmp/main.exe
tidy:
go mod tidy
test:
go test -cover $(PKG)
test-race:
-gotestsum -- -cover -race $(PKG)
gotestsum --watch -- -cover -race $(PKG)
test-watch:
-gotestsum -- -cover $(PKG)
gotestsum --watch -- -cover $(PKG)
test-coverage:
go test -coverprofile=coverage.out $(PKG)
go tool cover -html=coverage.out
lint:
golangci-lint run $(PKG)
lint-nill:
nilaway $(PKG)
format:
go fmt $(PKG)
db-vet:
sqlc vet
db-generate:
sqlc generate
db-status:
goose status
db-migrate:
goose up
db-rollback:
goose down
db-reset:
goose reset
setup-tools:
go install gotest.tools/gotestsum@$(GOTESTSUM_VERSION)
go install github.com/air-verse/air@$(AIR_VERSION)
go install go.uber.org/nilaway/cmd/nilaway@$(NILAWAY_VERSION)
go install github.com/sqlc-dev/sqlc/cmd/sqlc@$(SQLC_VERSION)
go install github.com/pressly/goose/v3/cmd/goose@$(GOOSE_VERSION)
go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@$(GOLANGCI_LINT_VERSION)
setup-hooks:
npm i -g @commitlint/cli @commitlint/config-conventional
git config core.hooksPath ./.hooks
setup-scripts:
cd scripts && npm i
setup: setup-tools setup-hooks setup-scripts
openapi-generate:
npm run start --prefix ./scripts
openapi-generate-commit:
npm run start:commit --prefix ./scripts