-
-
Notifications
You must be signed in to change notification settings - Fork 33
Expand file tree
/
Copy pathTaskfile.yml
More file actions
103 lines (86 loc) · 2.63 KB
/
Taskfile.yml
File metadata and controls
103 lines (86 loc) · 2.63 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
# https://taskfile.dev
version: "3"
silent: true
tasks:
default:
cmds:
- DEBUG=true go run . {{.CLI_ARGS}}
interactive: true
desc: Run
debug:
cmds:
- printf "~\n~\n~\n~\n~\n~\n~\n~\n~\n~\n~\n~\n~\n~\n~\n―――――――――――――――――――――――――――――――――――――――――――――――\n" > ./debug.log
- DEBUG=true LOG_LEVEL={{.LOG_LEVEL}} go run . {{.CLI_ARGS}}
interactive: true
desc: Run in debug mode. Run `task logs` to watch the logs.
install:
desc: Install the application
vars:
LDFLAGS: '{{if .VERSION}}-ldflags="-X github.com/dlvhdr/diffnav/pkg/version.Version={{.VERSION}}"{{end}}'
cmds:
- go install {{.LDFLAGS}} -v .
sources:
- ./**/*.go
- go.mod
diff:
cmds:
- task: install
- GH_PAGER=diffnav gh pr diff {{.CLI_ARGS}}
desc: "Run in gh pr diff. Usage: task diff -- <GitHub PR URL>"
debug:info:
cmds:
- task: debug
vars:
LOG_LEVEL: info
interactive: true
desc: Run in debug mode with INFO level logs. Run `task logs` to watch the logs.
dlv:
cmds:
- dlv debug --headless --api-version=2 --listen=127.0.0.1:43000 . -- {{.CLI_ARGS}}
desc: Debug with dlv
local-gh:
cmds:
- printf "~\n~\n~\n~\n~\n~\n~\n~\n~\n~\n~\n~\n~\n~\n~\n―――――――――――――――――――――――――――――――――――――――――――――――\n" > ./debug.log
- GH_PATH=/usr/local/bin/gh DEBUG=true go run ./main.go {{.CLI_ARGS}}
interactive: true
desc: Run in debug mode with a local gh install. Run `task logs` to watch the logs.
logs:
cmds:
- rm -f ./debug.log
- touch ./debug.log
- tail -f ./debug.log
interactive: true
desc: Tail the debug logs
lint:
desc: Run base linters
cmds:
- golangci-lint run --path-mode=abs --config=".golangci.yml" --timeout=5m
env:
GOEXPERIMENT: null
lint-fix:
desc: Run base linters and fix issues
cmds:
- golangci-lint run --path-mode=abs --config=".golangci.yml" --timeout=5m --fix
env:
GOEXPERIMENT: null
test:
cmds:
- go test -v ./...
desc: Run tests
fmt:
desc: Run golangci-lint fmt
cmds:
- golangci-lint fmt
check-nerd-font:
cmds:
- nerdfix check $(fd --extension go)
desc: Find broken nerdfont characters
fix-nerd-font:
cmds:
- nerdfix fix --format=json $(fd --extension go)
desc: Fix broken nerdfont icons
release:
cmds:
- git checkout main
- git tag $(svu next)
- git push --tags