-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathmise.toml
104 lines (82 loc) · 2.23 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
[settings]
experimental = true
[env]
GOTESTSUM_FORMAT = "pkgname"
GOBIN = "{{ config_root }}/bin"
PROJECT_ROOT = "{{ config_root }}"
_.path = ["{{ config_root }}/bin"]
[alias]
# Specify sources for all tools so we can refer to them directly.
requiredfield = "go:go.abhg.dev/requiredfield/cmd/requiredfield"
golangci-lint = "ubi:golangci/golangci-lint"
changie = "ubi:miniscruff/changie"
[tools]
# Self-explanatory.
go = "latest"
# Test runner with prettier output.
gotestsum = "latest"
# Stricter code formatting.
gofumpt = "latest"
# Check for required fields in structs.
requiredfield = "0.3.0"
# Collection of linters.
golangci-lint = "latest"
# Changelog manager.
changie = "latest"
[tasks.generate]
depends = ["tools:*"]
description = "Update generated code"
run = [
"go generate -x ./...",
"(cd doc && mise run generate)",
]
[tasks.test]
wait_for = ["generate"]
description = "Run tests"
run = "gotestsum -- ./..."
[tasks.cover]
wait_for = ["generate"]
description = "Run tests with coverage"
run = [
"gotestsum -- '-coverprofile=cover.out' '-coverpkg=./...' ./...",
"go tool cover '-html=cover.out' -o cover.html",
]
[tasks.tidy]
run = "go mod tidy"
description = "Update go.mod and go.sum files"
[tasks.fmt]
run = "gofumpt -w ."
description = "Format all go files"
[tasks.lint]
depends = ["lint:*"]
wait_for = ["generate"]
description = "Run all lint checks"
[tasks."lint:golangci-lint"]
run = "golangci-lint run"
description = "Run golangci-lint"
[tasks."lint:requiredfield"]
run = "go vet -vettool=$(command -v requiredfield) ./..."
description = "Check for required fields"
[tasks."lint:tidy"]
run = "go mod tidy -diff"
description = "Ensure go.mod and go.sum are up to date"
[tasks.build]
run = "go install go.abhg.dev/gs"
wait_for = ["generate"]
description = "Build the gs binary"
# mockgen version is pinned in go.mod
# so don't use mise's go backend.
[tasks."tools:mockgen"]
sources = ["go.mod"]
outputs = ["bin/mockgen"]
run = "go install go.uber.org/mock/mockgen"
description = "Install mockgen"
hide = true
[tasks.changie]
run = "changie"
description = "Convenience alias to run changie"
[tasks."doc:serve"]
run = "cd doc && mise run serve"
description = "Serve the documentation"
[tasks."doc:build"]
run = "cd doc && mise run build"