From 7df85655b683918a5035253e5a58285306c3578b Mon Sep 17 00:00:00 2001 From: Jon Huhn Date: Fri, 1 Dec 2023 12:28:26 -0600 Subject: [PATCH] include *_test.go files for lint rules already ignored in test/ --- .golangci.yml | 4 ++-- internal/test/env/env_test.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 841f10c9b9c..75759896c47 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -132,13 +132,13 @@ issues: text: "use underscores in Go names|receiver name (.+) should be consistent|methods on the same type should have the same receiver name" - path: 'mock(\w+)/doc.go$' text: "use underscores in package names|don't use an underscore in package name" - - path: ^test/ + - path: (^test/|_test.go$) linters: - dogsled - goconst - godot - prealloc - - path: ^test/ + - path: (^test/|_test.go$) text: exported (.+) should have comment( \(or a comment on this block\))? or be unexported # Need to use the deprecated module "github.com/Azure/azure-sdk-for-go/services" till issue #2670 is addressed. - linters: diff --git a/internal/test/env/env_test.go b/internal/test/env/env_test.go index 5181094d556..eca24986183 100644 --- a/internal/test/env/env_test.go +++ b/internal/test/env/env_test.go @@ -25,7 +25,7 @@ import ( ) func TestGetFilePathToCAPICRDs(t *testing.T) { - _, filename, _, _ := goruntime.Caller(0) //nolint:dogsled // Ignore "declaration has 3 blank identifiers" check. + _, filename, _, _ := goruntime.Caller(0) root := path.Join(path.Dir(filename), "..", "..", "..") g := gomega.NewWithT(t) g.Expect(getFilePathToCAPICRDs(root)).To(gomega.MatchRegexp(`(.+)/pkg/mod/sigs\.k8s\.io/cluster-api@v(.+)/config/crd/bases`))