1# https://taskfile.dev
2
3version: "3"
4
5env:
6 GOEXPERIMENT: greenteagc
7
8tasks:
9 lint:
10 desc: Run base linters
11 cmds:
12 - golangci-lint run --path-mode=abs --config=".golangci.yml" --timeout=5m
13
14 lint-fix:
15 desc: Run base linters and fix issues
16 cmds:
17 - golangci-lint run --path-mode=abs --config=".golangci.yml" --timeout=5m --fix
18
19 test:
20 desc: Run tests
21 cmds:
22 - go test ./... {{.CLI_ARGS}}
23
24 fmt:
25 desc: Run gofumpt
26 cmds:
27 - gofumpt -w .
28
29 dev:
30 desc: Run with profiling enabled
31 env:
32 CRUSH_PROFILE: true
33 cmds:
34 - go run .
35
36 install:
37 desc: Install the application
38 cmds:
39 - go install -v .
40
41 profile:cpu:
42 desc: 10s CPU profile
43 cmds:
44 - go tool pprof -http :6061 'http://localhost:6060/debug/pprof/profile?seconds=10'
45
46 profile:heap:
47 desc: Heap profile
48 cmds:
49 - go tool pprof -http :6061 'http://localhost:6060/debug/pprof/heap'
50
51 profile:allocs:
52 desc: Allocations profile
53 cmds:
54 - go tool pprof -http :6061 'http://localhost:6060/debug/pprof/allocs'
55
56 schema:
57 desc: Generate JSON schema for configuration
58 cmds:
59 - go run main.go schema > schema.json
60 - echo "Generated schema.json"