-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Taskfile.yml
59 lines (55 loc) · 1.52 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
version: "3"
tasks:
build:
desc: Build binary
cmds:
- go build -v .
fmt:
desc: Run lint tools
deps:
- task: tools
vars:
SHADOW:
sh: which shadow
cmds:
- gofmt -s -l .
- go vet
- go vet -vettool {{.SHADOW}}
- golint ./...
- staticcheck ./...
- errcheck ./...
- gosec -quiet -fmt=golint ./...
install:
desc: Install dependencies
cmds:
- go get
setup:
desc: Install git commit hook
status:
- test -f .git/hooks/commit-msg
- test ! -w .git/hooks/commit-msg
cmds:
- curl --fail -o .git/hooks/commit-msg https://gist.githubusercontent.com/MrMarble/509ae7fdec449b7fbe10fa11eb54bc16/raw/9789eb6e184dfddf64c34f3545b4d1e3bc275f36/commit-msg
- chmod 500 .git/hooks/commit-msg
generates:
- .git/hooks/commit-msg
tools:
desc: Install development tools
status:
- test -f $GOPATH/bin/errcheck
- test -f $GOPATH/bin/golint
- test -f $GOPATH/bin/gosec
- test -f $GOPATH/bin/shadow
- test -f $GOPATH/bin/staticcheck
cmds:
- go install golang.org/x/tools/go/analysis/passes/shadow/cmd/shadow
- go install golang.org/x/lint/golint
- go install honnef.co/go/tools/cmd/staticcheck
- go install github.com/kisielk/errcheck
- go install github.com/securego/gosec/cmd/gosec
generates:
- "$GOPATH/bin/errcheck"
- "$GOPATH/bin/gosec"
- "$GOPATH/bin/shadow"
- "$GOPATH/bin/staticcheck"
- "$GOPATH/bin/golint"