Repository navigation
Expand file tree
/
Copy pathTaskfile.yml
More file actions
51 lines (50 loc) · 1.43 KB
/
Copy pathTaskfile.yml
File metadata and controls
51 lines (50 loc) · 1.43 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
version: "3"
tasks:
default:
cmds:
- task: help
help:
desc: Show command usage
silent: true
cmds:
- |
echo "cacheq"
echo ""
echo "Usage:"
echo " task help Show command usage"
echo " task fmt Format Go source"
echo " task lint Check Go code without modifying it"
echo " task test Run tests with race detection"
echo " task test-cover Run tests with coverage"
echo " task build Compile the library"
echo " task hooks Install local Git hooks"
fmt:
desc: Format Go source
cmds:
- gofmt -w .
- golangci-lint fmt
lint:
desc: Check Go code without modifying it
cmds:
- go vet ./...
- golangci-lint run --timeout=5m
test:
desc: Run tests with race detection
cmds:
- go test -race ./... -count=1
test-cover:
desc: Run tests with coverage
cmds:
- go test -race ./... -coverprofile=coverage.out -count=1
- go tool cover -func=coverage.out
build:
desc: Compile the library
cmds:
- go build ./...
hooks:
desc: Install local Git hooks
preconditions:
- sh: command -v "${LEFTHOOK_BIN:-lefthook}"
msg: 'Install Lefthook first (for example: brew install lefthook), then run task hooks again.'
cmds:
- git config --local core.hooksPath .githooks