-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.yml
More file actions
143 lines (119 loc) · 4.43 KB
/
Copy pathTaskfile.yml
File metadata and controls
143 lines (119 loc) · 4.43 KB
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
version: '3'
vars:
BIN: browserctrl
# Cross-compile targets: the Linux/Windows root tables are only proven by
# compiling, so the check gate builds every OS the roots.go table names.
CROSS_TARGETS: linux/amd64 linux/arm64 windows/amd64 darwin/arm64
tasks:
default:
desc: List tasks
cmds:
- task --list
build:
desc: Build the CLI into ./bin
cmds:
- go build -o bin/{{.BIN}} .
install:
desc: Install the CLI into $GOPATH/bin (or $GOBIN)
cmds:
- go install .
run:
desc: List every profile with the Claude extension (running first)
cmds:
- go run . list {{.CLI_ARGS}}
find:
desc: 'Print the device id for a query, e.g. task find -- legable'
cmds:
- go run . find {{.CLI_ARGS}}
docs:capture:
desc: 'Print real CLI output against the doc fixture, e.g. task docs:capture -- list --json'
deps: [build]
cmds:
- go run ./internal/docfixture .docs-fixture ./bin/{{.BIN}} {{.CLI_ARGS}}
fmt:
desc: gofmt every Go file in place
cmds:
- gofmt -w .
vet:
desc: go vet
cmds:
- go vet ./...
lint:
desc: staticcheck + golangci-lint (both must be on PATH)
cmds:
- staticcheck ./...
- golangci-lint run ./...
test:
desc: Full test suite with the race detector (includes the markdown lint)
cmds:
- go test -race ./...
test:cover:
desc: Statement coverage for the whole module, written to cover.out
cmds:
- go test -coverprofile=cover.out -coverpkg=./... ./...
- go tool cover -func=cover.out | tail -1
test:cover:html:
desc: Open the coverage report in a browser
deps: [test:cover]
cmds:
- go tool cover -html=cover.out
test:uncovered:
desc: List every function below 100% statement coverage
cmds:
- go test -coverprofile=cover.out -coverpkg=./... ./... > /dev/null
- 'go tool cover -func=cover.out | grep -v "100.0%" || echo "everything is covered"'
cover:
desc: The measured numbers the README quotes — per package (own tests) and merged total
cmds:
- echo "── per package (each package's own tests)"
- 'go test -cover ./... 2>&1 | grep -E "^ok" | sed -E "s/[[:space:]]+[0-9.]+s//"'
- echo "── merged total (every package, -coverpkg=./...)"
- go test -coverprofile=cover.out -coverpkg=./... ./... > /dev/null
- go tool cover -func=cover.out | tail -1
cross:
desc: Cross-compile for every OS the roots table claims to support
cmds:
- for: { var: CROSS_TARGETS }
cmd: GOOS={{splitList "/" .ITEM | first}} GOARCH={{splitList "/" .ITEM | last}} go build -o /dev/null ./...
fmt-check:
desc: Fail if any Go file is not gofmt-clean (prints the offenders)
cmds:
- 'test -z "$(gofmt -l .)" || { gofmt -l .; echo "gofmt needed on the files above"; exit 1; }'
# ── voltkit (github.com/khanakia/voltkit) ───────────────────────────────
# Everything under volt:* shells out to the `volt` binary: it owns the gate
# (its own golangci config + SKILL.md lint), release streams, tagging,
# archives, checksums, the Homebrew formula and the skills bundle. Install:
# `brew install khanakia/tap/volt`. Config: .volt.yml at the repo root.
volt:ci:
desc: '[voltkit] the gate: fmt, vet, golangci-lint (volt config), race tests, SKILL.md lint'
cmds:
- volt ci --all
volt:doctor:
desc: '[voltkit] is this repo releasable? tools, auth, remote, clean tree, brew token'
cmds:
- volt doctor
volt:status:
desc: '[voltkit] release streams — last tag, commits since, suggested next version'
cmds:
- volt status
volt:gen:
desc: '[voltkit] regenerate hash-guarded files: task volt:gen (workflows, install scripts) · task volt:gen -- skills (skills wiring)'
cmds:
- volt gen {{.CLI_ARGS}}
volt:release:snapshot:
desc: '[voltkit] rehearse the release — every platform + checksums into dist/, publish nothing'
cmds:
- volt release . --snapshot
volt:release:
desc: '[voltkit] release (tag vX.Y.Z; archives, checksums, skills bundle, brew formula): task volt:release -- --bump patch | -- v0.2.0'
cmds:
- volt release . {{.CLI_ARGS}}
check:
desc: The real gate — fmt check, vet, lint, tests, cross-compile, tidy check
cmds:
- task: fmt-check
- task: vet
- task: lint
- task: test
- task: cross
- go mod tidy -diff