-
Notifications
You must be signed in to change notification settings - Fork 0
/
Taskfile.yml
69 lines (56 loc) · 1.32 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
# https://taskfile.dev
version: '3'
vars:
GOPROXY: 'https://goproxy.cn,direct'
GOSUMDB: sum.golang.google.cn
GOOS: $(go env GOOS)
GOARCH: $(go env GOARCH)
tasks:
gencopyright:
desc: generate code license
cmds:
- go install github.com/google/addlicense@latest
- hack/scripts/gencopyright.sh
gofmt:
cmds:
- go install golang.org/x/tools/cmd/goimports@latest
- gofmt -s -w .
- goimports -w .
govulncheck:
desc: vulnerability detection
cmds:
- go install golang.org/x/vuln/cmd/[email protected]
- govulncheck ./...
golint:
cmds:
- go install github.com/golangci/golangci-lint/cmd/[email protected]
- golangci-lint run -v ./...
gci:
cmds:
- go install github.com/daixiang0/[email protected]
- gci write --skip-generated --custom-order -s standard -s "prefix(github.com/easysoft/gitfox-webhooks)" -s default -s blank -s dot .
gomod:
cmds:
- go mod tidy
lint:
desc: lint code
cmds:
- task: gomod
- task: gofmt
- task: gci
- task: golint
- task: govulncheck
fmt:
desc: format code
run: once
cmds:
- task: gencopyright
- task: lint
run:
desc: debug run
cmds:
- go run ./example/example.go
default:
cmds:
- task: fmt
- task: run