-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTaskfile.yml
90 lines (76 loc) · 1.77 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
version: "3"
vars:
COVEROUT: cover.out
GOBIN: $(go env GOPATH)/bin
tasks:
default:
deps: [dev]
coverage:
summary: Generate test coverage
cmds:
- task: test
vars:
CLI_ARGS: -coverprofile={{.COVEROUT}} -covermode=atomic -coverpkg=./...
sources:
- "**/*.go"
generates:
- "{{.COVEROUT}}"
covercheck:
summary: Check test coverage
deps:
- coverage
cmds:
- go tool github.com/vladopajic/go-test-coverage/v2 --config=./.testcoverage.yml
dev:
summary: Development mode
cmd: go run . {{.CLI_ARGS}}
build:
summary: Build application
cmd: go build -o dist/upd .
clean:
summary: Clean the project
cmds:
- go clean
- rm -f {{.COVEROUT}}
fixlint:
summary: Fix lint issues
deps: [devdep]
cmds:
- go tool github.com/golangci/golangci-lint/cmd/golangci-lint run --fix
fmt:
summary: Format the code
cmds:
- go tool github.com/daixiang0/gci write .
- go tool mvdan.cc/gofumpt -w .
tidy:
summary: Tidy the module
cmds:
- go mod tidy -v
depup:
summary: Upgrades dependencies
cmds:
- go get -u -t ./...
- task tidy
lint:
summary: Lint code
deps:
- task: runlinter
vars:
RUN: vet
- task: runlinter
vars:
RUN: tool honnef.co/go/tools/cmd/staticcheck
- task: runlinter
vars:
RUN: tool github.com/securego/gosec/v2/cmd/gosec -fmt=golint -quiet
- task: runlinter
vars:
RUN: tool github.com/golangci/golangci-lint/cmd/golangci-lint run
runlinter:
summary: Run specific linter
requires:
vars: [RUN]
cmd: go {{.RUN}} ./...
test:
summary: Run tests
cmd: go test ./... {{.CLI_ARGS}}