forked from Antonboom/testifylint
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTaskfile.yml
69 lines (57 loc) · 1.38 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
# https://taskfile.dev/#/installation
version: '3'
silent: true
vars:
COVERED_PKGS: |
./analyzer
./internal/analysisutil
./internal/checkers
./internal/config
tasks:
default:
cmds:
- task: tidy
- task: fmt
- task: lint
- task: test
- task: install
tools:install:
- echo "Install dev tools..."
- go install github.com/daixiang0/gci@latest
- go install mvdan.cc/gofumpt@latest
tidy:
cmds:
- echo "Tidy..."
- go mod tidy
fmt:
cmds:
- echo "Fmt..."
- gofumpt -w .
- gci write -s standard -s default -s "Prefix(github.com/Antonboom/testifylint)" . 2> /dev/null
lint:
cmds:
- echo "Lint..."
- golangci-lint run --fix ./...
test:
deps: [ test:gen ]
cmds:
- echo "Test..."
- go test ./...
test:coverage:
env:
GOEXPERIMENT: nocoverageredesign # https://github.com/golang/go/issues/65653#issuecomment-1955872134
cmds:
- echo "Test with coverage..."
- go test -coverpkg={{ .COVERED_PKGS | trim | splitLines | join "," }} -coverprofile=coverage.out ./...
test:gen:
cmds:
- echo "Generate analyzer tests..."
- go run ./internal/testgen
profile:
cmds:
- echo "Do profiling..."
- go test -memprofile=mem.out -cpuprofile=cpu.out ./analyzer
install:
cmds:
- echo "Install..."
- go install .