-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathTaskfile.yml
96 lines (85 loc) · 3.03 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
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
version: '3'
tasks:
# DEV SETUP
install-tool:
label: install-{{.BINARY_NAME}}
dir: tools
internal: true
requires:
vars: [ BINARY_NAME, TOOL_PKG ]
cmd: go build -o ../.tools/{{.BINARY_NAME}} {{.TOOL_PKG}}
sources:
- go.mod
- go.sum
- tools.go
generates:
- ../.tools/{{.BINARY_NAME}}
install-gofumpt:
summary: Install mvdan.cc/gofumpt.
desc: >-
Install mvdan.cc/gofumpt to .tools directory for local use. gofumpt is a
stricter gofmt.
cmd:
task: install-tool
vars:
BINARY_NAME: gofumpt
TOOL_PKG: mvdan.cc/gofumpt
install-gci:
summary: Install github.com/daixiang0/gci.
desc: >-
Install github.com/daixiang0/gci to .tools directory for local use. gci is
a tool that controls Go pkg import order and makes it deterministic.
cmd:
task: install-tool
vars:
BINARY_NAME: gci
TOOL_PKG: github.com/daixiang0/gci
install-golangci-lint:
summary: Install github.com/golangci/golangci-lint/cmd/golangci-lint.
desc: >-
Install github.com/golangci/golangci-lint/cmd/golangci-lint to .tools
directory for local use. golangci-lint is a fast linters runner for Go.
cmd:
task: install-tool
vars:
BINARY_NAME: golangci-lint
TOOL_PKG: github.com/golangci/golangci-lint/cmd/golangci-lint
install-present:
summary: Install golang.org/x/tools/cmd/present.
desc: >-
Install golang.org/x/tools/cmd/present to .tools directory for local
use. present displays slide presentations and articles..
cmd:
task: install-tool
vars:
BINARY_NAME: present
TOOL_PKG: golang.org/x/tools/cmd/present
install-tools:
summary: Install developer tools.
deps: [ install-gofumpt, install-gci, install-golangci-lint, install-present ]
desc: Install all developer CLI tools to .tools directory for local use.
imports:
summary: Format imports with gci.
desc: >-
Format package imports in all Go files with gci.
deps: [ install-gci ]
cmd: .tools/gci write ./ --section standard --section default --section "Prefix(github.com/netskope,github.com/netSkope)" --skip-generated --skip-vendor
fmt:
summary: Formats Go files including import statements.
desc: >-
Formats Go source files with gci for import statements and gofumpt.
deps: [ install-gofumpt, imports ]
cmd: .tools/gofumpt -l -w -extra .
lint:
summary: Lint Go source files with golangci-lint and report all issues.
desc: >-
Lints Go source files with golangci-lint and reports all issues without
any filtering. It uses the configuration present in .golangci-prod.toml
for running the linter.
deps: [ install-golangci-lint ]
cmd: .tools/golangci-lint --config=".golangci-prod.toml" --max-same-issues=0 --max-issues-per-linter=0 run
present:
summary: Run the present tool
desc: Runs the present tool with presenter notes enabled
deps: [ install-present ]
cmd: .tools/present -notes -use_playground