Skip to content

Commit a15c012

Browse files
authored
Merge pull request #1415 from tpounds/golangci-lint-v1.18.0
✨ Update to golangci-lint v1.18.0
2 parents 1d7c4b9 + f3c5735 commit a15c012

File tree

4 files changed

+38
-82
lines changed

4 files changed

+38
-82
lines changed

.golangci.yml

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,22 @@
11
linters:
2-
enable:
3-
- govet
4-
- golint
5-
- gofmt
6-
- goimports
7-
- structcheck
8-
- varcheck
9-
- interfacer
10-
- unconvert
11-
- ineffassign
12-
- goconst
13-
- gocyclo
14-
- misspell
15-
- nakedret
16-
- prealloc
17-
- gosec
18-
disable-all: true
2+
enable-all: true
3+
disable:
4+
- dupl
5+
- errcheck
6+
- funlen
7+
- gochecknoglobals
8+
- gochecknoinits
9+
- gocritic
10+
- lll
11+
- scopelint
12+
- staticcheck
13+
- unparam
14+
- unused
1915
# Run with --fast=false for more extensive checks
2016
fast: true
21-
issue:
17+
issues:
2218
max-same-issues: 0
23-
max-per-linter: 0
19+
max-issues-per-linter: 0
2420
run:
2521
deadline: 2m
2622
skip-files:

cmd/clusterctl/phases/pivot_test.go

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -310,9 +310,7 @@ func (s *sourcer) GetClusters(ns string) ([]*clusterv1.Cluster, error) {
310310
if ns == "" {
311311
out := []*clusterv1.Cluster{}
312312
for _, clusters := range s.clusters {
313-
for _, cluster := range clusters {
314-
out = append(out, cluster)
315-
}
313+
out = append(out, clusters...)
316314
}
317315
return out, nil
318316
}
@@ -324,9 +322,7 @@ func (s *sourcer) GetMachineDeployments(ns string) ([]*clusterv1.MachineDeployme
324322
if ns == "" {
325323
out := []*clusterv1.MachineDeployment{}
326324
for _, mds := range s.machineDeployments {
327-
for _, md := range mds {
328-
out = append(out, md)
329-
}
325+
out = append(out, mds...)
330326
}
331327
return out, nil
332328
}
@@ -348,9 +344,7 @@ func (s *sourcer) GetMachines(ns string) ([]*clusterv1.Machine, error) {
348344
if ns == "" {
349345
out := []*clusterv1.Machine{}
350346
for _, machines := range s.machines {
351-
for _, m := range machines {
352-
out = append(out, m)
353-
}
347+
out = append(out, machines...)
354348
}
355349
return out, nil
356350
}
@@ -362,9 +356,7 @@ func (s *sourcer) GetMachineSets(ns string) ([]*clusterv1.MachineSet, error) {
362356
if ns == "" {
363357
out := []*clusterv1.MachineSet{}
364358
for _, machineSets := range s.machineSets {
365-
for _, ms := range machineSets {
366-
out = append(out, ms)
367-
}
359+
out = append(out, machineSets...)
368360
}
369361
return out, nil
370362
}

hack/tools/go.mod

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,9 @@ module sigs.k8s.io/cluster-api/hack/tools
33
go 1.12
44

55
require (
6-
github.com/golang/mock v1.3.1 // indirect
7-
github.com/golang/protobuf v1.3.2 // indirect
8-
github.com/golangci/golangci-lint v1.17.1
9-
golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0 // indirect
10-
golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0 // indirect
6+
github.com/golangci/golangci-lint v1.18.0
117
k8s.io/code-generator v0.0.0-20190831074504-732c9ca86353
128
sigs.k8s.io/controller-tools v0.2.0
139
sigs.k8s.io/kubebuilder/docs/book/utils v0.0.0-20190903174343-de03361a00cb
1410
sigs.k8s.io/testing_frameworks v0.1.1
1511
)
16-
17-
replace (
18-
// TODO(vincepri) Remove the following replace directives, needed for golangci-lint until
19-
// https://github.com/golangci/golangci-lint/issues/595 is fixed.
20-
github.com/go-critic/go-critic v0.0.0-20181204210945-1df300866540 => github.com/go-critic/go-critic v0.0.0-20190526074819-1df300866540
21-
github.com/golangci/errcheck v0.0.0-20181003203344-ef45e06d44b6 => github.com/golangci/errcheck v0.0.0-20181223084120-ef45e06d44b6
22-
github.com/golangci/go-tools v0.0.0-20180109140146-af6baa5dc196 => github.com/golangci/go-tools v0.0.0-20190318060251-af6baa5dc196
23-
github.com/golangci/gofmt v0.0.0-20181105071733-0b8337e80d98 => github.com/golangci/gofmt v0.0.0-20181222123516-0b8337e80d98
24-
github.com/golangci/gosec v0.0.0-20180901114220-66fb7fc33547 => github.com/golangci/gosec v0.0.0-20190211064107-66fb7fc33547
25-
github.com/golangci/ineffassign v0.0.0-20180808204949-42439a7714cc => github.com/golangci/ineffassign v0.0.0-20190609212857-42439a7714cc
26-
github.com/golangci/lint-1 v0.0.0-20180610141402-ee948d087217 => github.com/golangci/lint-1 v0.0.0-20190420132249-ee948d087217
27-
github.com/timakin/bodyclose => github.com/golangci/bodyclose v0.0.0-20190714144026-65da19158fa2
28-
mvdan.cc/unparam v0.0.0-20190124213536-fbb59629db34 => mvdan.cc/unparam v0.0.0-20190209190245-fbb59629db34
29-
)

0 commit comments

Comments
 (0)