-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmise.toml
170 lines (149 loc) · 5.07 KB
/
mise.toml
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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
min_version = "2025.2.5"
[hooks]
enter = "mise i -q"
[settings]
experimental = true
lockfile = true
[tasks.ast-grep]
description = "Run ast-grep rules against the library source code."
hide = true
run = "ast-grep scan"
depends = "build"
# If this task and test run at the same time, force eg to run last to improve
# diagnostics in case of test compilation failures.
wait_for = ["test"]
[tasks.ast-grep-test]
description = "Run the tests for the ast-grep rules."
hide = true
run = "ast-grep test"
sources = ["sgconfig.yml", "sg/**"]
outputs = { auto = true }
# If this task and test run at the same time, force it to run last to improve
# diagnostics in case of test compilation failures.
wait_for = ["test"]
[tasks.build]
description = "Build the library source code."
run = "go build ./..."
sources = ["go.mod", "go.sum", "**/*.go"]
outputs = { auto = true }
depends = ["generate"]
alias = "b"
[tasks.check]
description = "Run all linters and tests against the library source code."
depends = ["lint", "test"]
alias = "c"
[tasks.default]
depends = ["check"]
[tasks.depaware]
description = "Check that no Go package dependencies changed unexpectedly."
hide = true
run = "go run internal/tasks.go depaware"
depends = ["build"]
sources = ["go.mod", "go.sum", "**/*.go", "**/depaware.txt"]
outputs = { auto = true }
[tasks.eg]
description = "Check that the library source code is already refactored according to the eg templates."
hide = true
run = "go run internal/tasks.go eg"
depends = ["build"]
sources = ["go.mod", "go.sum", "**/*.go", "eg/*.template"]
outputs = { auto = true }
# If this task and test run at the same time, force it to run last to improve
# diagnostics in case of test compilation failures.
wait_for = ["test"]
[tasks.fix]
description = "Automatically fix as many lint errors as possible."
run = [
"go mod tidy",
"ast-grep scan --update-all",
"go run internal/tasks.go eg-fix",
"golangci-lint run --fix",
"go run internal/tasks.go depaware-fix",
]
depends = ["build"]
alias = "f"
[tasks.generate]
description = "Run go:generate instructions in the library source code."
run = "go generate ./..."
depends = ["go-sanity-check"]
sources = ["go.mod", "go.sum", "**/*.go"]
outputs = { auto = true }
alias = "g"
[tasks.go-mod-graph]
description = "Generate a graph of this project's module dependencies. It will be written to file 'module-graph.dot' in the Graphviz DOT format. Install https://graphviz.org/ to turn it into a pretty picture."
run = """
#!/usr/bin/env bash
go mod graph | digraph to dot > module-graph.dot
printf "Install Graphviz https://graphviz.org/, run 'dot -Tsvg -o module-graph.svg module-graph.dot' and open module-graph.svg in your web browser.\n"
"""
[tasks.go-mod-tidy-diff]
description = "Check that 'go mod tidy' has been run"
hide = true
run = "go mod tidy -diff"
depends = ["go-sanity-check"]
[tasks.go-sanity-check]
description = "Run various quick Go-related sanity checks against the project"
hide = true
run = ["go mod verify", "go mod download"]
[tasks.golangci-lint]
description = "Check that no problems are found when running the linters defined in .golangci.yml against the library source code."
hide = true
run = "golangci-lint run"
depends = "build"
sources = ["go.mod", "go.sum", "**/*.go"]
outputs = { auto = true }
# If this task and test run at the same time, force it to run last to improve
# diagnostics in case of test compilation failures.
wait_for = ["test"]
[tasks.lint]
description = "Check the library source code for problems."
hide = true
depends = [
"ast-grep",
"ast-grep-test",
"depaware",
"eg",
"go-sanity-check",
"go-mod-tidy-diff",
"golangci-lint",
]
[tasks.nilaway]
description = "Check that no common sources of nil pointer dereferences can occur in the library source code."
hide = true
run = "nilaway -include-pkgs github.com/jbduncan/go-containers ./..."
depends = "build"
sources = ["go.mod", "go.sum", "**/*.go"]
outputs = { auto = true }
# If this task and test run at the same time, force it to run last to improve
# diagnostics in case of test compilation failures.
wait_for = ["test"]
[tasks.test]
description = "Run tests for the library source code."
run = "go test -shuffle=on -race ./..."
depends = "build"
sources = ["go.mod", "go.sum", "**/*.go"]
outputs = { auto = true }
alias = "t"
[tasks.test-rerun]
description = "Run tests for the library source code, even if no changes have been made."
run = "go test -shuffle=on -race ./..."
depends = "build"
sources = ["go.mod", "go.sum", "**/*.go"]
alias = "tr"
[tasks.update-versions]
description = "Update the versions of all tools and dependencies."
run = ["mise x -- go get -u -t ./...", "mise up"]
alias = "u"
[tools]
# cosign is used by mise itself to download tools more securely
cosign = "latest"
go = "latest"
"go:github.com/tailscale/depaware" = "b748de0"
"go:go.uber.org/nilaway/cmd/nilaway" = "ba14292"
"go:golang.org/x/tools/cmd/digraph" = "latest"
"go:golang.org/x/tools/cmd/eg" = "latest"
"go:golang.org/x/tools/cmd/stringer" = "latest"
golangci-lint = "latest"
# slsa-verifier is used by mise itself to download tools more securely
slsa-verifier = "latest"
"ubi:ast-grep/ast-grep" = "latest"