Repository navigation
Expand file tree
/
Copy pathTaskfile.yml
More file actions
95 lines (79 loc) · 1.97 KB
/
Copy pathTaskfile.yml
File metadata and controls
95 lines (79 loc) · 1.97 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
version: '3'
vars:
VERSION:
sh: git describe --tags --always --dirty 2>/dev/null || echo "dev"
COMMIT:
sh: git rev-parse --short HEAD 2>/dev/null || echo "unknown"
BUILD_TIME:
sh: date -u '+%Y-%m-%dT%H:%M:%SZ'
tasks:
default:
desc: Show available tasks
cmds:
- task --list-all
build:
desc: Build the library (verify compilation)
cmds:
- go build ./...
test:
desc: Run tests
cmds:
- go test -v -race ./...
test:coverage:
desc: Run tests with coverage report
cmds:
- go test -v -race -coverprofile=coverage.txt -covermode=atomic ./...
- go tool cover -html=coverage.txt -o coverage.html
- echo "Coverage report generated at coverage.html"
test:short:
desc: Run tests (short mode)
cmds:
- go test -v -short ./...
lint:
desc: Run linters
cmds:
- golangci-lint run ./...
fmt:
desc: Format code
cmds:
- go fmt ./...
- goimports -w .
tidy:
desc: Tidy go modules
cmds:
- go mod tidy
vet:
desc: Run go vet
cmds:
- go vet ./...
clean:
desc: Clean build artifacts
cmds:
- rm -f coverage.txt coverage.html
- go clean -cache -testcache
check:
desc: Run all checks (fmt, vet, lint, test)
cmds:
- task: fmt
- task: vet
- task: lint
- task: test
bench:
desc: Run benchmarks
cmds:
- go test -bench=. -benchmem ./...
doc:
desc: Start documentation server
cmds:
- echo "Starting godoc server at http://localhost:6060/pkg/github.com/coldsmirk/go-streams/v2/"
- godoc -http=:6060
modernize:
desc: Run Go modernize analyzer to suggest code modernizations
cmds:
- go run golang.org/x/tools/gopls/internal/analysis/modernize/cmd/modernize@latest -test ./...
version:
desc: Display version information
cmds:
- echo "Version {{.VERSION}}"
- echo "Commit {{.COMMIT}}"
- echo "Build Time {{.BUILD_TIME}}"