-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathTaskfile.yml
97 lines (81 loc) · 2.58 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
90
91
92
93
94
95
96
97
version: '3'
vars:
CONFIG: config.dev.toml
MIGRATIONS: pkg/storage/db/migrations
CSS_IN: pkg/ui/css/global.css
CSS_OUT: pkg/static/public/css/global.css
tasks:
setup:config:
desc: "Copy the base config.toml to the development config file."
cmds:
- cp config.toml {{.CONFIG}}
setup:tooling:
desc: "Install necessary Go tools and dependencies."
cmds:
- go install -tags 'postgres' github.com/golang-migrate/migrate/v4/cmd/migrate@latest
- go install github.com/sqlc-dev/sqlc/cmd/sqlc@latest
- go install github.com/a-h/templ/cmd/templ@latest
- go install github.com/air-verse/air@latest
- go install honnef.co/go/tools/cmd/staticcheck@latest
- go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
- go install golang.org/x/vuln/cmd/govulncheck@latest
- go install github.com/securego/gosec/v2/cmd/gosec@latest
gen:sqlc:
desc: "Generate Go code from SQL queries using sqlc."
cmds:
- sqlc generate
gen:templ:
desc: "Generate code from templates using templ."
cmds:
- templ generate
gen:tailwind:
desc: "Process CSS files with Tailwind CSS in watch mode with minification."
cmds:
- ./tmp/tailwindcss -i {{.CSS_IN}} -o {{.CSS_OUT}} --watch --minify
migrate:add:
desc: "Create a new database migration file."
vars:
SEQ: '{{default "initial" .SEQ}}'
cmds:
- migrate create -ext sql -dir {{.MIGRATIONS}} -seq "{{.SEQ}}"
migrate:up:
desc: "Apply all migrations to the database."
cmds:
- go run . migrate --config {{.CONFIG}} up
migrate:down:
desc: "Revert all migrations to the database."
cmds:
- go run . migrate --config {{.CONFIG}} down
dev:fmt:
desc: "Format Go code according to the standard Go style."
cmds:
- templ fmt .
- gofmt -l -w .
dev:vet:
desc: "Examine Go source code and report suspicious constructs."
cmds:
- go vet ./...
dev:static:
desc: "Perform advanced static analysis using staticcheck."
cmds:
- staticcheck ./...
dev:lintci:
desc: "Run golangci-lint to execute multiple linters."
cmds:
- golangci-lint run ./...
dev:vuln:
desc: "Scan for known vulnerabilities in dependencies using govulncheck."
cmds:
- govulncheck ./...
dev:sec:
desc: "Check for common security issues with gosec."
cmds:
- gosec ./...
dev:lint:
desc: "Run all linting and security analysis tools."
cmds:
- task: dev:vet
- task: dev:static
- task: dev:lintci
- task: dev:vuln
- task: dev:sec