-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrunx.yaml
48 lines (47 loc) · 1.29 KB
/
runx.yaml
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
default: lint
actions:
- id: lint
desc: Run golangci-lint on your local folder
type: run
shell:
pwd: pwd
gopath: go env GOPATH
gocache: go env GOCACHE
cmd: |
--rm \
{{if .IsTTY}}-t{{end}} \
-v {{sh "pwd"}}:/app \
-v {{sh "gopath"}}/pkg:/go/pkg \
-v {{sh "gocache"}}:/cache/go \
-e GOFLAGS=-buildvcs=false \
-e GOCACHE=/cache/go \
-e GOLANGCI_LINT_CACHE=/cache/go \
-w /app \
{{.Ref}} \
golangci-lint run --timeout 5m
- id: with-config
desc: Run golangci-lint with a specific config file
type: run
shell:
pwd: pwd
gopath: go env GOPATH
gocache: go env GOCACHE
opts:
- name: config
desc: The path to the golangci-lint config file
prompt: Please enter the path to the config file
type: input
required: true
cmd: |
--rm \
{{if .IsTTY}}-t{{end}} \
-v {{sh "pwd"}}:/app \
-v {{sh "gopath"}}/pkg:/go/pkg \
-v {{sh "gocache"}}:/cache/go \
--mount type=bind,source={{sh "pwd"}}/{{opt "config"}},target=/.golangci.yml \
-e GOFLAGS=-buildvcs=false \
-e GOCACHE=/cache/go \
-e GOLANGCI_LINT_CACHE=/cache/go \
-w /app \
{{.Ref}} \
golangci-lint run -c /.golangci.yml --timeout 5m