Skip to content

Commit

Permalink
Upgrade golangci-lint to v1.23.8 (#4181)
Browse files Browse the repository at this point in the history
* Upgrade golangci-lint to v1.23.8

This should help with some timeouts we're seeing in CI.

I fixed some new warnings found in `inject.go` and `uninject.go`.
Also we now have to explicitly disable linting `/controller/gen`.

The linter was also complaining that in `/pkg/k8s/fake.go` the
`spClient.Interface` and `tsclient.Interface` returned in the function
`newFakeClientSetsFromManifests()` aren't used, but I opted to ignore
that to leave them available for future tests.
  • Loading branch information
alpeb committed Mar 18, 2020
1 parent 8f79e07 commit 1cbc26a
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

run:
deadline: 5m
skip-dirs:
- controller/gen
issues:
exclude-use-default: false
linters:
Expand Down
2 changes: 1 addition & 1 deletion bin/lint
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -eu

lintversion=1.19.1
lintversion=1.23.8

cd "$(pwd -P)"

Expand Down
2 changes: 1 addition & 1 deletion cli/cmd/inject.go
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ func (resourceTransformerInject) generateReport(reports []inject.Report, output
if r.Kind != "" {
output.Write([]byte(fmt.Sprintf("%s \"%s\" skipped\n", r.Kind, r.Name)))
} else {
output.Write([]byte(fmt.Sprintf("document missing \"kind\" field, skipped\n")))
output.Write([]byte(fmt.Sprintln("document missing \"kind\" field, skipped")))
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion cli/cmd/uninject.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ func (resourceTransformerUninject) generateReport(reports []inject.Report, outpu
if r.Kind != "" {
output.Write([]byte(fmt.Sprintf("%s \"%s\" skipped\n", r.Kind, r.Name)))
} else {
output.Write([]byte(fmt.Sprintf("document missing \"kind\" field, skipped\n")))
output.Write([]byte(fmt.Sprintln("document missing \"kind\" field, skipped")))
}
}
}
Expand Down
1 change: 1 addition & 0 deletions pkg/k8s/fake.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ func NewFakeClientSets(configs ...string) (
// newFakeClientSetsFromManifests reads from a slice of readers, each
// representing a manifest or collection of manifests, and returns a mock
// Kubernetes ClientSet.
//nolint:unparam
func newFakeClientSetsFromManifests(readers []io.Reader) (
kubernetes.Interface,
apiextensionsclient.Interface,
Expand Down

0 comments on commit 1cbc26a

Please sign in to comment.