-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTaskfile.yaml
138 lines (127 loc) · 4.82 KB
/
Taskfile.yaml
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
version: '3'
vars:
TOOLSET: go run ../cmd/toolset
tasks:
tools:install:
desc: Install tools
run: once
cmds:
- echo ">> Install tools..."
- go run github.com/kazhuravlev/toolset/cmd/toolset@latest sync
fmt:
desc: Format codebase
deps:
- "tools:install"
vars:
GO_FILES:
sh: "find . -type f -name '*.go' -not -path './internal/version/*' | xargs echo"
cmds:
- echo ">>> Format code..."
- go fmt ./...
- toolset run gofumpt -l -w {{.GO_FILES}}
- toolset run goimports -d -w {{.GO_FILES}}
lint:
desc: Run static analysis
deps:
- "tools:install"
cmds:
- echo ">> Run linter..."
- toolset run golangci-lint run ./...
tests:
desc: Run project tests
deps:
- "tools:install"
cmds:
- echo ">> Run tests..."
- toolset run gotestsum
upd:dl:
- rm -rf dl
- git clone --depth 1 https://github.com/golang/dl.git
- rm -rf internal/version
- mv dl/internal/version internal/version
- rm -rf dl
- rm ./internal/version/gotip.go
- go test ./internal/version
init:
dir: temp_tests
cmds:
- "rm .toolset.json .toolset.lock.json || true"
- "rm -rf ./bin"
- "{{.TOOLSET}} init --copy-from git+https://gist.github.com/c92c40d0e4329c1c2fe9372216474cd7.git:/formatters.json"
test:remove:
dir: temp_tests
cmds:
- task: "init"
- "{{.TOOLSET}} sync"
- "{{.TOOLSET}} which goimports gofumpt"
- "{{.TOOLSET}} list"
- "{{.TOOLSET}} remove goimports gofumpt"
- "{{.TOOLSET}} list"
test:alias:
dir: temp_tests
cmds:
- task: "init"
- "{{.TOOLSET}} add go github.com/vburenin/ifacemaker iface"
- "{{.TOOLSET}} sync"
- "{{.TOOLSET}} list"
- ls -lsa bin/tools | grep iface
test:runtimes:
dir: temp_tests
cmds:
- "rm .toolset.json .toolset.lock.json || true"
- "rm -rf ./bin"
- "{{.TOOLSET}} init"
- "{{.TOOLSET}} runtime add [email protected]"
- "{{.TOOLSET}} runtime list"
- "{{.TOOLSET}} add [email protected] golang.org/x/tools/cmd/goimports"
- "{{.TOOLSET}} sync"
- "{{.TOOLSET}} remove goimports"
- "{{.TOOLSET}} add go golang.org/x/tools/cmd/goimports"
- "{{.TOOLSET}} sync"
- "{{.TOOLSET}} remove goimports"
- "{{.TOOLSET}} list"
test:
dir: temp_tests
cmds:
- task: "init"
- "{{.TOOLSET}} add -tags group1 go golang.org/x/tools/cmd/[email protected]"
- "{{.TOOLSET}} add go golang.org/x/tools/cmd/goimports"
- "{{.TOOLSET}} add go golang.org/x/tools/cmd/goimports@latest"
- "{{.TOOLSET}} add go github.com/bufbuild/buf/cmd/[email protected]"
- "{{.TOOLSET}} add go github.com/go-delve/delve/cmd/dlv@latest"
- "{{.TOOLSET}} add go github.com/go-swagger/go-swagger/cmd/swagger@latest"
- "{{.TOOLSET}} add go github.com/golangci/golangci-lint/cmd/[email protected]"
- "{{.TOOLSET}} add go github.com/goreleaser/goreleaser/v2@latest"
- "{{.TOOLSET}} add go github.com/kisielk/errcheck@latest"
- "{{.TOOLSET}} add --tags group1 go github.com/mgechev/revive@latest"
- "{{.TOOLSET}} add --tags group1 go github.com/segmentio/golines@latest"
- "{{.TOOLSET}} add --tags group1 go honnef.co/go/tools/cmd/[email protected]"
- "{{.TOOLSET}} sync --tags group1"
- "{{.TOOLSET}} add --tags formatter,ci go golang.org/x/tools/cmd/[email protected]"
- "{{.TOOLSET}} add --tags local,ci go github.com/kazhuravlev/git-tools/cmd/gt"
- "{{.TOOLSET}} add --tags local,ci,linters go github.com/golangci/golangci-lint/cmd/[email protected]"
- "{{.TOOLSET}} upgrade --tags linters"
- "{{.TOOLSET}} add --tags formatters --copy-from git+https://gist.github.com/c92c40d0e4329c1c2fe9372216474cd7.git:/formatters.json"
- "{{.TOOLSET}} add --tags codegen --include git+ssh://[email protected]:c92c40d0e4329c1c2fe9372216474cd7.git:/codegen.json"
- "{{.TOOLSET}} add --tags formatters --include git+https://gist.github.com/c92c40d0e4329c1c2fe9372216474cd7.git:/formatters.json"
- "{{.TOOLSET}} list"
- "{{.TOOLSET}} sync --tags codegen"
- "{{.TOOLSET}} list"
- "{{.TOOLSET}} sync"
- "{{.TOOLSET}} which buf gt dlv"
- "{{.TOOLSET}} upgrade --tags codegen"
- "{{.TOOLSET}} upgrade"
- "{{.TOOLSET}} sync"
- "{{.TOOLSET}} run gt tag last"
- "{{.TOOLSET}} list"
- "{{.TOOLSET}} run buf --version"
- "{{.TOOLSET}} run dlv version"
- "{{.TOOLSET}} run swagger version"
- "{{.TOOLSET}} run golangci-lint version"
- "{{.TOOLSET}} run goreleaser --version"
- "{{.TOOLSET}} run revive --version"
- "{{.TOOLSET}} run golines --version"
- "{{.TOOLSET}} run staticcheck -version"
- "{{.TOOLSET}} run gt --version"
- "{{.TOOLSET}} run gofumpt --version"
- "{{.TOOLSET}} list"