Repository navigation
Expand file tree
/
Copy pathTaskfile.yml
More file actions
93 lines (77 loc) · 2.13 KB
/
Copy pathTaskfile.yml
File metadata and controls
93 lines (77 loc) · 2.13 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
# https://taskfile.dev
#
# Tasks for the appdir module. Run them from this directory, or from the repo
# root as `task appdir:<task>` — the root Taskfile includes this file.
#
# Every module carries the same task names on purpose: `task test` means the
# same thing everywhere, so moving between modules costs no re-learning.
version: "3"
tasks:
default:
desc: List available tasks
cmds:
- task --list
silent: true
test:
desc: Run tests
cmds:
- go test ./...
test:race:
desc: Run tests with the race detector
cmds:
- go test -race ./...
test:cover:
desc: Report statement coverage
cmds:
- go test -coverprofile=cover.out ./...
- 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 functions below 100% coverage
cmds:
- go test -coverprofile=cover.out ./... > /dev/null
- 'go tool cover -func=cover.out | grep -v "100.0%" || echo "everything is covered"'
vet:
desc: Run go vet
cmds:
- go vet ./...
lint:
desc: Run golangci-lint when it is installed
cmds:
- 'which golangci-lint > /dev/null && golangci-lint run ./... || echo "golangci-lint not installed; skipping"'
fmt:
desc: Format the source
cmds:
- gofmt -w .
fmt:check:
desc: Fail when the source is unformatted
cmds:
- |
out=$(gofmt -l .)
if [ -n "$out" ]; then echo "gofmt needed on:"; echo "$out"; exit 1; fi
tidy:
desc: Tidy go.mod and go.sum
cmds:
- go mod tidy
doc:
desc: Print the package's exported API
cmds:
- go doc -all .
deps:
desc: Show this module's third-party dependencies
cmds:
- 'go list -deps ./... | grep "\." | grep -v ubgo/voltkit | sort -u || echo "none — stdlib only"'
ci:
desc: The full gate for this module — format, vet, race tests
cmds:
- task: fmt:check
- task: vet
- task: test:race
clean:
desc: Remove coverage artifacts
cmds:
- rm -f cover.out cover.html