Skip to content

Commit

Permalink
Merge pull request #1415 from tpounds/golangci-lint-v1.18.0
Browse files Browse the repository at this point in the history
✨ Update to golangci-lint v1.18.0
  • Loading branch information
k8s-ci-robot committed Sep 12, 2019
2 parents 1d7c4b9 + f3c5735 commit a15c012
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 82 deletions.
34 changes: 15 additions & 19 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,22 @@
linters:
enable:
- govet
- golint
- gofmt
- goimports
- structcheck
- varcheck
- interfacer
- unconvert
- ineffassign
- goconst
- gocyclo
- misspell
- nakedret
- prealloc
- gosec
disable-all: true
enable-all: true
disable:
- dupl
- errcheck
- funlen
- gochecknoglobals
- gochecknoinits
- gocritic
- lll
- scopelint
- staticcheck
- unparam
- unused
# Run with --fast=false for more extensive checks
fast: true
issue:
issues:
max-same-issues: 0
max-per-linter: 0
max-issues-per-linter: 0
run:
deadline: 2m
skip-files:
Expand Down
16 changes: 4 additions & 12 deletions cmd/clusterctl/phases/pivot_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -310,9 +310,7 @@ func (s *sourcer) GetClusters(ns string) ([]*clusterv1.Cluster, error) {
if ns == "" {
out := []*clusterv1.Cluster{}
for _, clusters := range s.clusters {
for _, cluster := range clusters {
out = append(out, cluster)
}
out = append(out, clusters...)
}
return out, nil
}
Expand All @@ -324,9 +322,7 @@ func (s *sourcer) GetMachineDeployments(ns string) ([]*clusterv1.MachineDeployme
if ns == "" {
out := []*clusterv1.MachineDeployment{}
for _, mds := range s.machineDeployments {
for _, md := range mds {
out = append(out, md)
}
out = append(out, mds...)
}
return out, nil
}
Expand All @@ -348,9 +344,7 @@ func (s *sourcer) GetMachines(ns string) ([]*clusterv1.Machine, error) {
if ns == "" {
out := []*clusterv1.Machine{}
for _, machines := range s.machines {
for _, m := range machines {
out = append(out, m)
}
out = append(out, machines...)
}
return out, nil
}
Expand All @@ -362,9 +356,7 @@ func (s *sourcer) GetMachineSets(ns string) ([]*clusterv1.MachineSet, error) {
if ns == "" {
out := []*clusterv1.MachineSet{}
for _, machineSets := range s.machineSets {
for _, ms := range machineSets {
out = append(out, ms)
}
out = append(out, machineSets...)
}
return out, nil
}
Expand Down
20 changes: 1 addition & 19 deletions hack/tools/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,9 @@ module sigs.k8s.io/cluster-api/hack/tools
go 1.12

require (
github.com/golang/mock v1.3.1 // indirect
github.com/golang/protobuf v1.3.2 // indirect
github.com/golangci/golangci-lint v1.17.1
golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0 // indirect
golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0 // indirect
github.com/golangci/golangci-lint v1.18.0
k8s.io/code-generator v0.0.0-20190831074504-732c9ca86353
sigs.k8s.io/controller-tools v0.2.0
sigs.k8s.io/kubebuilder/docs/book/utils v0.0.0-20190903174343-de03361a00cb
sigs.k8s.io/testing_frameworks v0.1.1
)

replace (
// TODO(vincepri) Remove the following replace directives, needed for golangci-lint until
// https://github.com/golangci/golangci-lint/issues/595 is fixed.
github.com/go-critic/go-critic v0.0.0-20181204210945-1df300866540 => github.com/go-critic/go-critic v0.0.0-20190526074819-1df300866540
github.com/golangci/errcheck v0.0.0-20181003203344-ef45e06d44b6 => github.com/golangci/errcheck v0.0.0-20181223084120-ef45e06d44b6
github.com/golangci/go-tools v0.0.0-20180109140146-af6baa5dc196 => github.com/golangci/go-tools v0.0.0-20190318060251-af6baa5dc196
github.com/golangci/gofmt v0.0.0-20181105071733-0b8337e80d98 => github.com/golangci/gofmt v0.0.0-20181222123516-0b8337e80d98
github.com/golangci/gosec v0.0.0-20180901114220-66fb7fc33547 => github.com/golangci/gosec v0.0.0-20190211064107-66fb7fc33547
github.com/golangci/ineffassign v0.0.0-20180808204949-42439a7714cc => github.com/golangci/ineffassign v0.0.0-20190609212857-42439a7714cc
github.com/golangci/lint-1 v0.0.0-20180610141402-ee948d087217 => github.com/golangci/lint-1 v0.0.0-20190420132249-ee948d087217
github.com/timakin/bodyclose => github.com/golangci/bodyclose v0.0.0-20190714144026-65da19158fa2
mvdan.cc/unparam v0.0.0-20190124213536-fbb59629db34 => mvdan.cc/unparam v0.0.0-20190209190245-fbb59629db34
)
Loading

0 comments on commit a15c012

Please sign in to comment.