Taskfile.yaml

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