-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTaskfile.yaml
71 lines (63 loc) · 2.04 KB
/
Taskfile.yaml
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
version: "3"
tasks:
pre-commit:
desc: Run pre-commit checks
silent: true
ignore_error: true
cmds:
- echo "Starting pre-commit checks..."
- pre-commit autoupdate || (echo "Failed to autoupdate pre-commit"; exit 1)
- pre-commit install || (echo "Failed to install pre-commit"; exit 1)
- pre-commit run --all-files || (echo "Pre-commit checks failed"; exit 1)
- echo "Pre-commit checks completed successfully"
gomod-update:
desc: Update Go modules
silent: true
ignore_error: true
cmds:
- echo "Updating Go modules..."
- go get -v -u all && go get -u ./... && go mod tidy || (echo "Go module update failed"; exit 1)
- echo "Go modules updated successfully"
gofmt:
desc: Format Go code
silent: true
ignore_error: true
cmds:
- echo "Formatting Go code..."
- go fmt ./... || (echo "go fmt failed"; exit 1)
- goimports -w . || (echo "goimports failed"; exit 1)
- echo "Go code formatting completed successfully"
govet:
desc: Run Go vet
silent: true
cmds:
- echo "Running Go vet..."
- go vet -v ./... || (echo "Go vet found issues"; exit 1)
- echo "Go vet completed successfully"
golangci-lint:
desc: Run golangci-lint
silent: true
ignore_error: true
cmds:
- echo "Running golangci-lint..."
- golangci-lint run --out-format colored-line-number || (echo "golangci-lint failed"; exit 1)
- echo "golangci-lint completed successfully"
lint-fmt:
desc: Run all lint and formatting tasks
silent: true
ignore_error: true
cmds:
- echo "Starting all lint and formatting tasks..."
- task: pre-commit
- task: gomod-update
- task: gofmt
- task: govet
- task: golangci-lint
- echo "All lint and formatting tasks completed successfully"
all:
silent: true
desc: Run the full workflow (lint, format, tag, and push)
cmds:
- echo "Starting full workflow..."
- task: lint-fmt
- echo "Full workflow completed successfully"