This repository was archived by the owner on Jul 18, 2025. It is now read-only.
Commit 83e60a2
Ian Campbell
ci: Switch from gometalinter to golangci-lint
The former is deprecated in favour of the later, which is faster and less
memory hungry.
The `.golangci.yml` is a straight translation of the enabled linters and
exclusions from `gometalinter.json`, except:
- The exclusions of `specification/bindata.go` and `templateloader` no longer
seem relevant (nothing hits, the latter no longer exists) so those are
dropped.
- I didn't copy over the various tweaks to output formats (the `sort` key) nor
the deadline setting.
- There is currently no equivalent to the `WarnUnmatchedDirective` key, see
golangci/golangci-lint#404
- The `unparam` linter now catches a few things which it didn't before, these
are fixed here:
pkg/yatee/yatee.go:131:39: tokenize - result 1 (error) is always nil (unparam)
func tokenize(expr string) ([]string, error) {
^
pkg/yatee/yatee_test.go:31:47: `testProcess` - `parameters` always receives `parameters` (`"\nfoo: bar\nloop: $loop\napp:\n mode: debug\n release: false\n co...`) (unparam)
func testProcess(t *testing.T, input, output, parameters, error string) {
^
pkg/yatee/yatee_test.go:147:56: `testProcessWithOrder` - `error` is unused (unparam)
func testProcessWithOrder(t *testing.T, input, output, error string) {
^
The first and third by dropping the unused return value and parameter
respectively. For the middle one I marked as `nolint` since it makes sense to
keep `parameters` defined in the caller since they are combined with `input`
to produce `output` and it is useful to have them in the same context.
The `nakedret` linter is part of `golangci-lint` already so there is no need to
add it separately.
Signed-off-by: Ian Campbell <ijc@docker.com>1 parent 376c15d commit 83e60a2
6 files changed
Lines changed: 37 additions & 62 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
| 11 | + | |
| 12 | + | |
23 | 13 | | |
24 | 14 | | |
25 | 15 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
76 | | - | |
| 76 | + | |
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
| |||
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
131 | | - | |
| 131 | + | |
132 | 132 | | |
133 | 133 | | |
134 | 134 | | |
| |||
145 | 145 | | |
146 | 146 | | |
147 | 147 | | |
148 | | - | |
| 148 | + | |
149 | 149 | | |
150 | 150 | | |
151 | 151 | | |
| |||
199 | 199 | | |
200 | 200 | | |
201 | 201 | | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | | - | |
| 202 | + | |
206 | 203 | | |
207 | 204 | | |
208 | 205 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
32 | 35 | | |
33 | 36 | | |
34 | 37 | | |
| |||
144 | 147 | | |
145 | 148 | | |
146 | 149 | | |
147 | | - | |
| 150 | + | |
148 | 151 | | |
149 | 152 | | |
150 | 153 | | |
| |||
164 | 167 | | |
165 | 168 | | |
166 | 169 | | |
167 | | - | |
| 170 | + | |
168 | 171 | | |
169 | 172 | | |
170 | 173 | | |
| |||
176 | 179 | | |
177 | 180 | | |
178 | 181 | | |
179 | | - | |
| 182 | + | |
180 | 183 | | |
0 commit comments