-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathTaskfile.yml
More file actions
110 lines (93 loc) · 2.66 KB
/
Copy pathTaskfile.yml
File metadata and controls
110 lines (93 loc) · 2.66 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
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
version: '3'
silent: true
tasks:
default:
cmds:
- task --list-all
check:
desc: Run all project checks
cmds:
- echo "- Run all routines"
- task: tidy
- task: tools:install
- task: generate
- task: fmt
- task: lint
- task: tests
- task: bench
- task: scorecard
- task: examples:update
generate:
desc: Generate code
cmds:
- echo "- Run codegen"
- go generate ./options-gen/... ./internal/...
tidy:
cmds:
- echo "- Tidy"
- go mod tidy
fmt:
desc: Run code formatter
cmds:
- echo "- Format"
- go fmt ./...
tools:install:
desc: Install required tools (into local project dir)
run: once
cmds:
- echo "- Run install tools"
- go run github.com/kazhuravlev/toolset/cmd/toolset@v0.40.0 sync
lint:
desc: Run linter
cmds:
- echo "- Lint"
- task: 'tools:install'
- toolset run golangci-lint run --fix ./...
tests:
cmds:
- echo "- Tests"
- go test ./...
bench:
desc: Run benchmarks
cmds:
- echo "- Benchmarks"
- go test -run '^$' -bench . -benchmem ./internal/generator
scorecard:
desc: Run OpenSSF Scorecard checks
cmds:
- echo "- OpenSSF Scorecard"
- go run github.com/ossf/scorecard/v5@v5.5.0 --local=. --show-details
fuzz:
desc: Run fuzz tests
cmds:
- echo "- Fuzz tests"
- go test -run '^$' -fuzz '^FuzzCheckDefaultValue$' -fuzztime=10s -timeout=30s ./internal/generator
- go test -run '^$' -fuzz '^FuzzNormalizeTypeName$' -fuzztime=10s -timeout=30s ./internal/generator
- go test -run '^$' -fuzz '^FuzzFormatComment$' -fuzztime=10s -timeout=30s ./internal/generator
- go test -run '^$' -fuzz '^FuzzFindImportPath$' -fuzztime=10s -timeout=30s ./internal/generator
examples:update:
desc: Update examples directory
cmds:
- echo "- Update examples"
- go install -ldflags "-X 'github.com/kazhuravlev/options-gen/internal/version.version=qa-version'" ./cmd/options-gen
- task: examples:update:go-generate
- task: examples:update:go-generate-generics
- task: examples:update:go-generate-2options-1pkg
- task: examples:update:library
examples:update:library:
dir: examples/library
cmds:
- go run main.go
- go test .
examples:update:go-generate:
dir: examples/go-generate
cmds:
- go generate ./...
examples:update:go-generate-generics:
dir: examples/go-generate-generics
cmds:
- go generate ./...
examples:update:go-generate-2options-1pkg:
dir: examples/go-generate-2options-1pkg
cmds:
- go generate ./...