-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtaskfile.yml
More file actions
93 lines (79 loc) · 1.91 KB
/
Copy pathtaskfile.yml
File metadata and controls
93 lines (79 loc) · 1.91 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
version: "3"
tasks:
setup:
desc: Install the development toolchain from the Brewfile
cmds:
- brew bundle install --file=Brewfile
deps:check:
desc: Verify the Brewfile toolchain is installed
cmds:
- brew bundle check --file=Brewfile --verbose
default:
desc: Run all checks
aliases: [check]
cmds:
- task: fmt:check
- task: vet
- task: lint:check
- task: test
all:
desc: Run all checks, coverage, benchmarks, and fuzz tests
cmds:
- task: fmt:check
- task: vet
- task: lint:check
- task: test
- task: cover
- task: bench
- task: fuzz
fix:
desc: Run all fixes
cmds:
- task: fmt:fix
- task: lint:fix
fmt:check:
desc: Check formatting with gofumpt -extra
cmds:
- |
output="$(gofumpt -extra -l .)"
if [ -n "$output" ]; then
echo "$output"
echo "gofumpt formatting check failed: run 'task fmt:fix' to fix." >&2
exit 1
fi
fmt:fix:
desc: Fix formatting with gofumpt -extra
cmds:
- gofumpt -extra -w .
vet:
desc: Run go vet
cmds:
- go vet ./...
lint:check:
desc: Run golangci-lint
cmds:
- golangci-lint run ./...
lint:fix:
desc: Run golangci-lint with auto-fix
cmds:
- golangci-lint run --fix ./...
test:
desc: Run all tests
cmds:
- go test -race -count=1 ./...
cover:
desc: Run tests with coverage
cmds:
- go test -coverprofile=coverage.out ./...
- go tool cover -func=coverage.out | tail -1
- rm coverage.out
bench:
desc: Run benchmarks
cmds:
- go test -bench=. -benchmem ./...
fuzz:
desc: Run all fuzz tests (10s each)
cmds:
- go test -fuzz=FuzzSunriseSunset -fuzztime=10s ./...
- go test -fuzz=FuzzLunarPhase -fuzztime=10s ./...
- go test -fuzz=FuzzMoonriseMoonset -fuzztime=10s ./...