-
Notifications
You must be signed in to change notification settings - Fork 9
/
Taskfile.yml
98 lines (81 loc) · 1.94 KB
/
Taskfile.yml
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
89
90
91
92
93
94
95
96
97
98
# https://taskfile.dev
version: "3"
vars:
GOPROXY: "https://goproxy.cn,direct"
GOSUMDB: sum.golang.google.cn
tasks:
gencopyright:
cmds:
- go install github.com/google/addlicense@latest
- ./gencopyright.sh
tools:
run: once
cmds:
- go install github.com/go-swagger/go-swagger/cmd/swagger@latest
- go install github.com/swaggo/swag/cmd/swag@latest
gomod:
desc: update go mod
cmds:
- go mod tidy
gofmt:
cmds:
- go install golang.org/x/tools/cmd/goimports@latest
- gofmt -s -w .
- goimports -w .
golint:
desc: lint package
cmds:
- go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.61.0
- golangci-lint run -v ./...
coverage:
desc: test package
dir: zentao
cmds:
- go test -v ./... -coverprofile=../coverage.txt -covermode count
- go tool cover -func=../coverage.txt
gci:
cmds:
- go install github.com/daixiang0/gci@latest
- gci write --skip-generated --custom-order -s standard -s "prefix(github.com/easysoft/go-zentao)" -s default -s blank -s dot .
lint:
desc: lint package
cmds:
- task: gomod
- task: gofmt
- task: golint
- task: gci
initgithooks:
desc: pre dev init githooks
run: once
cmds:
- git config core.hooksPath .githooks
dev:
desc: dev
cmds:
- docker compose -f hack/docker-compose.yml up -d
swag:
desc: generate swagger
run: once
cmds:
- task: tools
- swag init -d zentao -g zentao.go --packageName main
clean:
desc: clean
cmds:
- docker compose -f hack/docker-compose.yml down -v
codegpt:
desc: generate code commit message
deps:
- fmt
cmds:
- git add .
- codegpt commit --diff_unified 5 --exclude_list docs
fmt:
cmds:
- task: swag
- task: gencopyright
- task: lint
default:
cmds:
- task: initgithooks
- task: fmt