forked from timakin/golangci-lint-orb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
orb.yml
108 lines (108 loc) · 3.25 KB
/
orb.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
96
97
98
99
100
101
102
103
104
105
106
107
108
commands:
lint:
description: |
Runs the golangci-lint
parameters:
attach-workspace:
default: false
description: |
Boolean for whether or not to attach to an existing workspace. Default is false.
type: boolean
checkout:
default: true
description: |
Boolean for whether or not to checkout as a first step. Default is true.
type: boolean
directories:
default: ./...
description: Directory path list of the lint target
type: string
working-directory:
default: .
description: Directory path for this job
type: string
workspace-root:
default: .
description: |
Workspace root path that is either an absolute path or a path relative to the working directory. Defaults to '.' (the working directory)
type: string
steps:
- when:
condition: << parameters.checkout >>
steps:
- checkout
- when:
condition: << parameters.attach-workspace >>
steps:
- attach_workspace:
at: << parameters.workspace-root >>
- run:
command: golangci-lint run << parameters.directories >>
name: Run golangci-lint
working_directory: << parameters.working-directory >>
description: |
Run golangci-lint https://github.com/golangci/golangci-lint
examples:
golangci:
description: Usage of valimail/golangci-lint orb
usage:
orbs:
golangci-lint: valimail/golangci-lint@volatile
version: 2.1
workflows:
build:
jobs:
- golangci-lint/lint
executors:
golangci:
docker:
- image: golangci/golangci-lint:<< parameters.tag >>
parameters:
tag:
default: latest
description: Tag of the docker image of `golangci/golangci-lint`
type: string
resource_class: small
jobs:
lint:
description: |
Lint the Go project with golangci-lint
executor:
name: golangci
tag: << parameters.tag >>
parameters:
attach-workspace:
default: false
description: |
Boolean for whether or not to attach to an existing workspace. Default is false.
type: boolean
checkout:
default: true
description: |
Boolean for whether or not to checkout as a first step. Default is true.
type: boolean
directories:
default: ./...
description: directory path list of the lint target
type: string
tag:
default: latest
description: tag of the docker image of `golangci/golangci-lint`
type: string
working-directory:
default: .
description: directory path for this job
type: string
workspace-root:
default: .
description: |
Workspace root path that is either an absolute path or a path relative to the working directory. Defaults to '.' (the working directory)
type: string
steps:
- lint:
attach-workspace: << parameters.attach-workspace >>
checkout: << parameters.checkout >>
directories: <<parameters.directories>>
working-directory: <<parameters.working-directory>>
workspace-root: << parameters.workspace-root >>
version: 2.1