-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.yml
More file actions
103 lines (87 loc) · 2.4 KB
/
Copy pathTaskfile.yml
File metadata and controls
103 lines (87 loc) · 2.4 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
version: "3"
vars:
BINARY: poplog-local-mcp
PKG: ./cmd/poplog-local-mcp
VERSION:
sh: git describe --tags --always --dirty 2>/dev/null || echo dev
tasks:
default:
desc: List available tasks
cmds:
- task --list
silent: true
build:
desc: Build the poplog-local-mcp binary into ./bin
cmds:
- go build -ldflags "-X main.version={{.VERSION}}" -o bin/{{.BINARY}} {{.PKG}}
run:
desc: Run the MCP server over stdio (Ctrl-C to stop)
cmds:
- go run {{.PKG}} {{.CLI_ARGS}}
interactive:
desc: Run MCP explorer
cmds:
- npx @modelcontextprotocol/inspector go run {{.PKG}}
go:test:
desc: Run the test suite with the race detector
cmds:
- go test -race ./...
go:test:pretty:
desc: Run tests with readable output (uses gotestsum if installed)
cmds:
- |
if command -v gotestsum >/dev/null 2>&1; then
gotestsum --format testname -- -race ./...
else
go test -race -v ./...
fi
go:test:ci:
desc: Run tests with coverage and machine-readable output for CI
cmds:
- mkdir -p dist
- go test -race -covermode=atomic -coverprofile=dist/coverage.out ./...
- go tool cover -func=dist/coverage.out | tail -1
cover:
desc: Generate and open an HTML coverage report
deps: [go:test:ci]
cmds:
- go tool cover -html=dist/coverage.out -o dist/coverage.html
- echo "Coverage report written to dist/coverage.html"
vet:
desc: Run go vet
cmds:
- go vet ./...
fmt:
desc: Format all Go source
cmds:
- gofmt -w .
fmt:check:
desc: Fail if any Go source is not formatted
cmds:
- test -z "$(gofmt -l .)" || (gofmt -l . && exit 1)
lint:
desc: Run golangci-lint if installed, otherwise vet + fmt check
cmds:
- |
if command -v golangci-lint >/dev/null 2>&1; then
golangci-lint run ./...
else
echo "golangci-lint not found; running go vet + gofmt check"
go vet ./...
test -z "$(gofmt -l .)" || (gofmt -l . && exit 1)
fi
tidy:
desc: Tidy and verify go modules
cmds:
- go mod tidy
- go mod verify
check:
desc: Run the full pre-commit gate (fmt check, vet, tests)
cmds:
- task: fmt:check
- task: vet
- task: go:test
clean:
desc: Remove build and coverage artifacts
cmds:
- rm -rf bin dist