Skip to content

Commit

Permalink
Fix linter warnings
Browse files Browse the repository at this point in the history
Also disable certain golangci-lin linters that do not make sense to the
project

Co-authored-by: Giuseppe Capizzi <[email protected]>
  • Loading branch information
danail-branekov and gcapizzi committed May 12, 2022
1 parent 680f03d commit b0a39b9
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 4 deletions.
19 changes: 18 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,15 @@ linters:
error types should be [xX]xxError. error vars should be errXxx.
nah.
- name: exhaustivestruct
- name: exhaustivestruct [deprecated]
desc: |
exhaustivestruct is meant for special checking only. It verifies that all
fields are set in struct construction, and so is not useful for us
- name: exhaustruct
desc: |
see exhaustivestruct
- name: funlen
desc: |
funlen is annoying
Expand Down Expand Up @@ -123,12 +127,25 @@ linters:
- name: ireturn
desc: |
lots of k8s libraries return interfaces so wrapping them is annoyingly reported by this linter
- name: nolintlint
desc: |
nilerr is disabled while linters catch up with go-1.18, and then nolintlint complains about
where we've ignored nilerr. So turn it off for now. Can be re-enabled when nilerr is no
longer ignored for go-1.18
- name: execinquery
desc: |
we don't use SQL
- name: nonamedreturns
desc: |
we use named returns sometimes
- name: nosprintfhostport
desc: |
we do not construct urls in the production code
enable:
- asciicheck
- bidichk
Expand Down
2 changes: 1 addition & 1 deletion cmd/wiring/lrp_reconciler.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"github.com/pkg/errors"
appsv1 "k8s.io/api/apps/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/util/clock"
"k8s.io/utils/clock"
"sigs.k8s.io/controller-runtime/pkg/builder"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/manager"
Expand Down
2 changes: 1 addition & 1 deletion prometheus/desire.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

eiriniv1 "code.cloudfoundry.org/eirini-controller/pkg/apis/eirini/v1"
prometheus_api "github.com/prometheus/client_golang/prometheus"
"k8s.io/apimachinery/pkg/util/clock"
"k8s.io/utils/clock"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion prometheus/desire_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
"github.com/onsi/gomega/types"
prometheus_api "github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/testutil"
"k8s.io/apimachinery/pkg/util/clock"
clock "k8s.io/utils/clock/testing"
"sigs.k8s.io/controller-runtime/pkg/metrics"
)

Expand Down

0 comments on commit b0a39b9

Please sign in to comment.