-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.yml
More file actions
158 lines (132 loc) · 4.5 KB
/
Taskfile.yml
File metadata and controls
158 lines (132 loc) · 4.5 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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
# https://taskfile.dev
version: "3"
vars:
BINARY: btfmt
GRAMMAR: bpftrace.g4
tasks:
default:
desc: Show available tasks
silent: true
cmds:
- task --list
# ─────────────────────────────────────────────────────────────
# Build & Development
# ─────────────────────────────────────────────────────────────
build:
desc: Build the btfmt binary
sources:
- "**/*.go"
- go.mod
- go.sum
generates:
- "{{.BINARY}}"
cmds:
- go build -o {{.BINARY}} ./cmd/btfmt
compile-grammar:
desc: Compile ANTLR grammar
sources:
- "{{.GRAMMAR}}"
generates:
- parser/*.go
cmds:
- uvx --from antlr4-tools antlr4 -Dlanguage=Go -o parser {{.GRAMMAR}}
clean:
desc: Remove build artifacts
cmds:
- rm -f {{.BINARY}}
- rm -f vscode-extension/*.vsix
# ─────────────────────────────────────────────────────────────
# Code Quality
# ─────────────────────────────────────────────────────────────
fmt:
desc: Format Go code
cmds:
- go fmt ./...
lint:
desc: Run golangci-lint
cmds:
- golangci-lint run ./...
vet:
desc: Run go vet
cmds:
- go vet ./...
check:
desc: Run all code quality checks (fmt, vet, lint)
cmds:
- task: fmt
- task: vet
- task: lint
# ─────────────────────────────────────────────────────────────
# Testing
# ─────────────────────────────────────────────────────────────
test:
desc: Run Go tests
cmds:
- go test ./...
test:verbose:
desc: Run Go tests with verbose output
cmds:
- go test -v ./...
test:cover:
desc: Run tests with coverage report
cmds:
- go test -coverprofile=coverage.out ./...
- go tool cover -html=coverage.out -o coverage.html
test-tools:
desc: Run tests against bpftrace/tools
cmds:
- go test ./formatter -run TestASTFormatter_FormatsBpftraceToolsTree
lsp-smoke:
desc: Smoke test for btfmt LSP (stdio)
deps:
- build
cmds:
- python3 scripts/lsp_smoke.py
# ─────────────────────────────────────────────────────────────
# VS Code Extension
# ─────────────────────────────────────────────────────────────
vscode:install:
desc: Install dependencies for the VS Code extension
dir: vscode-extension
cmds:
- npm install
vscode:build:
desc: Build the VS Code extension
dir: vscode-extension
deps:
- vscode:install
cmds:
- npm run compile
vscode:package:
desc: Package the VS Code extension (vsix)
dir: vscode-extension
deps:
- vscode:build
cmds:
- npx vsce package
vscode:publish:
desc: Publish the VS Code extension (requires VSCE_PAT)
dir: vscode-extension
deps:
- vscode:build
cmds:
- npx vsce publish
# ─────────────────────────────────────────────────────────────
# CI / Release
# ─────────────────────────────────────────────────────────────
ci:
desc: Run all CI checks (format, vet, test)
cmds:
- task: fmt
- task: vet
- task: test
all:
desc: Build and test everything
cmds:
- task: build
- task: test
gh-review:
desc: Notify bot to review on the current PR
cmds:
- gh pr comment --body "@codex review"
- gh pr comment --body "@gemini-code-assist review"