-
Notifications
You must be signed in to change notification settings - Fork 0
/
Taskfile.yaml
53 lines (45 loc) · 1.23 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
# https://taskfile.dev
version: "3"
vars:
BINDIR: bin
BINNAME: misspell-codeclimate
GIT_COMMIT:
sh: git rev-parse HEAD
GIT_SHA:
sh: git rev-parse --short HEAD
GIT_BRANCH:
sh: git branch --show-current
LDFLAGS: >
-X github.com/purpleclay/misspell-codeclimate/cmd.version=dev-{{.GIT_SHA}}
-X github.com/purpleclay/misspell-codeclimate/cmd.gitCommit={{.GIT_COMMIT}}
-X github.com/purpleclay/misspell-codeclimate/cmd.gitBranch={{.GIT_BRANCH}}
-X github.com/purpleclay/misspell-codeclimate/cmd.buildDate={{now | date "2006-01-02T15:04:05Z07:00"}}
tasks:
default:
desc: Runs all of the default tasks
cmds:
- task: lint
- task: test
- task: build
build:
desc: Build the misspell-codeclimate binary
cmds:
- go build -ldflags '-s -w {{.LDFLAGS}}' .
test:
desc: Run the tests
cmds:
- go test -race -vet=off -p 1 -covermode=atomic -coverprofile=coverage.out ./...
lint:
desc: Lint the code using golangci
cmds:
- golangci-lint run --timeout 5m0s
fmt:
desc: gofumpt all code
cmds:
- gofumpt -w -l .
clean:
desc: Delete all artefacts from recent build
cmds:
- rm ./{{.BINNAME}}
status:
- test -f ./{{.BINNAME}}