From 4eb539a6f750a7bf4def50f935127de5950235b6 Mon Sep 17 00:00:00 2001 From: Christian Heike Date: Tue, 8 Jun 2021 13:40:58 +0200 Subject: [PATCH 1/3] Update go.yml --- .github/workflows/go.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 94445ce..00a8900 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -25,6 +25,7 @@ jobs: uses: golangci/golangci-lint-action@v2 with: version: v1.40 + working-directory: ./pkg/... only-new-issues: true - name: Build From 2fe3f9bdf14254f279c50391eecae193fac5faea Mon Sep 17 00:00:00 2001 From: Christian Heike Date: Tue, 8 Jun 2021 13:44:15 +0200 Subject: [PATCH 2/3] Update go.yml --- .github/workflows/go.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 00a8900..94445ce 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -25,7 +25,6 @@ jobs: uses: golangci/golangci-lint-action@v2 with: version: v1.40 - working-directory: ./pkg/... only-new-issues: true - name: Build From b905d67e73037988df16c294be9801885b6d6615 Mon Sep 17 00:00:00 2001 From: Christian Heike Date: Tue, 8 Jun 2021 13:47:26 +0200 Subject: [PATCH 3/3] Fixed the remaining golangci-lint problems, shame on me that I only checked pkg --- .golangci.yml | 4 ++++ testing/admission_test/v1.go | 2 +- testing/admission_test/v1beta1.go | 2 +- testing/httpext_test/fixture.go | 4 ++-- testing/webhook_test/fixture.go | 4 ++-- 5 files changed, 10 insertions(+), 6 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 25133ac..319fd95 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -121,6 +121,10 @@ issues: linters: - lll - funlen + - path: testing + linters: + - gomnd + - revive run: timeout: 3m # skip generated files diff --git a/testing/admission_test/v1.go b/testing/admission_test/v1.go index 3dd4e35..683ae86 100644 --- a/testing/admission_test/v1.go +++ b/testing/admission_test/v1.go @@ -23,7 +23,7 @@ func (v *V1AdmissionReview) MustMarshal() []byte { return json_test.MarshalJSONOrPanic((*v1.AdmissionReview)(v)) } -//nolint:dupl +// nolint:dupl func NewV1Review(obj, oldObj testing.Reviewable) func() *V1AdmissionReview { rawExt, oldRawExt := rawExts(obj, oldObj) return func() *V1AdmissionReview { diff --git a/testing/admission_test/v1beta1.go b/testing/admission_test/v1beta1.go index 86b429c..362c293 100644 --- a/testing/admission_test/v1beta1.go +++ b/testing/admission_test/v1beta1.go @@ -21,7 +21,7 @@ func (v *V1Beta1AdmissionReview) MustMarshal() []byte { return json_test.MarshalJSONOrPanic((*v1beta1.AdmissionReview)(v)) } -//nolint:dupl +// nolint:dupl func NewV1Beta1Review(obj, oldObj testing.Reviewable) func() *V1Beta1AdmissionReview { rawExt, oldRawExt := rawExts(obj, oldObj) return func() *V1Beta1AdmissionReview { diff --git a/testing/httpext_test/fixture.go b/testing/httpext_test/fixture.go index 7d4f849..937dd73 100644 --- a/testing/httpext_test/fixture.go +++ b/testing/httpext_test/fixture.go @@ -3,7 +3,7 @@ package httpext_test import ( "github.com/dbsystel/kewl/pkg/httpext" "github.com/dbsystel/kewl/pkg/panicutils" - "github.com/go-logr/logr/testing" + "github.com/go-logr/logr" ) // Fixture is a fixture for testing httpext.Server @@ -34,7 +34,7 @@ func newFixture(enableHTTPS bool) *Fixture { config.TLSConfig.PublicKeyFile = pemFilePair.PublicKeyPath() config.TLSConfig.PrivateKeyFile = pemFilePair.PrivateKeyPath() } - server, err := httpext.NewServer(testing.NullLogger{}, config) + server, err := httpext.NewServer(logr.DiscardLogger{}, config) panicutils.PanicIfError(err) return &Fixture{Sut: server, Test: &TestFacade{ServeMux: server.ServeMux}} } diff --git a/testing/webhook_test/fixture.go b/testing/webhook_test/fixture.go index 9994d49..b9b6c00 100644 --- a/testing/webhook_test/fixture.go +++ b/testing/webhook_test/fixture.go @@ -4,7 +4,7 @@ import ( "github.com/dbsystel/kewl/pkg/panicutils" "github.com/dbsystel/kewl/pkg/webhook" "github.com/dbsystel/kewl/testing/httpext_test" - "github.com/go-logr/logr/testing" + "github.com/go-logr/logr" ) type Fixture struct { @@ -13,7 +13,7 @@ type Fixture struct { } func NewFixture() *Fixture { - server, err := webhook.NewServer(&testing.NullLogger{}, httpext_test.TestConfig()) + server, err := webhook.NewServer(&logr.DiscardLogger{}, httpext_test.TestConfig()) panicutils.PanicIfError(err) return &Fixture{Sut: server, Test: &ReviewFacade{&httpext_test.TestFacade{ServeMux: server.ServeMux}}} }