This repository was archived by the owner on Jan 14, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtaskfile.dist.yml
More file actions
106 lines (89 loc) · 2.95 KB
/
Copy pathtaskfile.dist.yml
File metadata and controls
106 lines (89 loc) · 2.95 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
104
105
106
# Copyright (c) Kopexa GmbH
# SPDX-License-Identifier: BUSL-1.1
version: "3"
vars:
GO_FUMPT: go tool mvdan.cc/gofumpt
GO_TEST: go tool gotest.tools/gotestsum --format pkgname
GO_COPYWRITE: go tool github.com/hashicorp/copywrite
tasks:
default:
silent: true
cmds:
- task --list
version:
desc: Show the version of the project
vars:
LATEST_VERSION_TAG:
sh: git describe --abbrev=0 --tags 2>/dev/null || echo "v0.0.0"
MANIFEST_VERSION:
sh: git describe --abbrev=0 --tags 2>/dev/null || echo "v0.0.0"
VERSION:
sh: echo "$(git describe --abbrev=0 --tags 2>/dev/null || echo 'v0.0.0')+$(git rev-list --count HEAD)"
cmds:
- |
echo "Latest Version Tag: {{.LATEST_VERSION_TAG}}"
- |
echo "Manifest Version: {{.MANIFEST_VERSION}}"
- |
echo "Version: {{.VERSION}}"
init:
desc: Initialize the project
cmds:
- task: prep
clean:proto:
desc: Clean up generated proto files
cmds:
- find . -not -path './.*' \( -name '*.ranger.go' -or -name '*.pb.go' -or -name '*.actions.go' -or -name '*-packr.go' -or -name '*.swagger.json' \) -delete
prep:
desc: Prepare the project
cmds:
- task: prep:tools
- lefthook install
lefthook:install:
desc: Install Lefthook hooks
cmds:
- lefthook install
prep:tools:
desc: Prepare tools for the project
cmds:
- go get -tool github.com/hashicorp/copywrite@latest
- go get -tool mvdan.cc/gofumpt@latest
- go get -tool gotest.tools/gotestsum@latest
- go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@latest
- go install github.com/evilmartians/lefthook@latest
- go install google.golang.org/protobuf/cmd/protoc-gen-go@latest # Ensure protoc-gen-go is installed
- go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest # Ensure protoc-gen-go-grpc is installed
- go install github.com/planetscale/vtprotobuf/cmd/protoc-gen-go-vtproto@latest # Ensure protoc-gen-go-vtproto is installed
prep:tools:protolint:
desc: Install Protolint
cmds:
- go install github.com/yoheimuta/protolint/cmd/protolint@latest
gen:
desc: Generate code for the project
cmds:
- go generate ./...
license:check:
desc: Check license headers in source files
cmds:
- "{{.GO_COPYWRITE}} headers --plan"
license:fix:
desc: Fix license headers in source files
cmds:
- "{{.GO_COPYWRITE}} headers"
lint:
desc: Run linters on the project
cmds:
- golangci-lint run --config .golangci.yaml
fmt:
desc: Format the codebase
cmds:
- "{{.GO_FUMPT}} -w ."
fmt:fix:
desc: Fix formatting issues
cmds:
- "{{.GO_FUMPT}} -d ."
test:unit:
desc: Run unit tests
cmds:
- mkdir -p build/reports
- "{{.GO_TEST}} --junitfile build/reports/test-unit.xml -- -race ./... -count=1 -short -cover -coverprofile build/reports/unit-test-coverage.out"