-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTaskfile.yml
89 lines (73 loc) · 2 KB
/
Taskfile.yml
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
version: "3"
tasks:
test:
desc: Run test suite
cmds:
- go test -v {{.CLI_ARGS}} ./...
test:all:
desc: Run test suite without caching
cmds:
- go test -count=1 -v {{.CLI_ARGS}} ./...
test:cover:
desc: Run test suite with coverage
cmds:
- go test -coverpkg ./... -coverprofile=coverage/coverage.out ./...
- go tool cover -html=coverage/coverage.out -o coverage/coverage.html
test:cover:badge:
desc: generate the coverage badge
cmds:
- ./scripts/badge.sh
doc:
desc: Serve godoc
cmds:
- go run golang.org/x/tools/cmd/godoc@latest -http=:6060
lint:
desc: Run linters
deps: [lint:prettier, lint:go]
lint:prettier:
desc: Check if prettier has been run
cmds:
- npx prettier --check .
lint:go:
desc: Run golangci-lint
cmds:
- go run github.com/golangci/golangci-lint/cmd/[email protected] run
publish:
desc: Publish a version
cmds:
- git tag -a v{{.VERSION}} -m "Release v{{.VERSION}}"
- git push origin v{{.VERSION}}
- GOPROXY=proxy.golang.org go list -m github.com/will-wow/typed-htmx-go@v{{.VERSION}}
fmt:
desc: Run all formatters
deps: [fmt:go, fmt:prettier]
fmt:go:
desc: Run goimports
cmds:
- go work sync
- go mod tidy
- go run golang.org/x/tools/cmd/[email protected] -w -local github.com/will-wow/typed-htmx-go .
fmt:prettier:
desc: Run prettier on non-go files
cmds:
- npx prettier --write .
ready:
desc: Format, lint, and test code. If this passes, then the code is ready to be committed.
cmds:
- task: fmt
- task: lint
- task: test:cover:badge
- task: examples:ready
tools:
desc: Install tools
cmds:
# Install prettier for formatting non-go files
- npm install
dev:
desc: Run the example server with a watch for templ, go, and static files
cmds:
- task: examples:dev
includes:
examples:
taskfile: ./examples/Taskfile.yml
dir: ./examples