Taskfile.yaml

 1# https://taskfile.dev
 2
 3version: "3"
 4
 5tasks:
 6  lint:
 7    desc: Run base linters
 8    cmds:
 9      - golangci-lint run
10
11  lint-fix:
12    desc: Run base linters and fix issues
13    cmds:
14      - golangci-lint run --fix
15
16  test:
17    desc: Run tests
18    cmds:
19      - go test ./... {{.CLI_ARGS}}
20
21  fmt:
22    desc: Run gofumpt
23    cmds:
24      - gofumpt -w .
25
26  dev:
27    desc: Run with profiling enabled
28    env:
29      CRUSH_PROFILE: true
30    cmds:
31      - go run .
32
33  profile:cpu:
34    desc: 10s CPU profile
35    cmds:
36      - go tool pprof -http :6061 'http://localhost:6060/debug/pprof/profile?seconds=10'
37
38  profile:heap:
39    desc: Heap profile
40    cmds:
41      - go tool pprof -http :6061 'http://localhost:6060/debug/pprof/heap'
42
43  profile:allocs:
44    desc: Allocations profile
45    cmds:
46      - go tool pprof -http :6061 'http://localhost:6060/debug/pprof/allocs'