Skip to content

Commit cedbd76

Browse files
chore(golangci-lint): add thelper linter
fix: remove dependency fix: remove sum lines
1 parent 889ea8c commit cedbd76

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

.golangci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ linters:
3838
- rowserrcheck
3939
- staticcheck
4040
- structcheck
41+
- thelper
4142
- typecheck
4243
- unconvert
4344
- unparam

exp/controllers/helpers_test.go

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,7 @@ func Test_ManagedMachinePoolToInfrastructureMapFunc(t *testing.T) {
570570
func Test_azureClusterToAzureMachinePoolsFunc(t *testing.T) {
571571
cases := []struct {
572572
Name string
573-
Setup func(*GomegaWithT, *testing.T) (*mock_log.MockLogSink, *gomock.Controller, client.Client)
573+
Setup func(*testing.T, *GomegaWithT) (*mock_log.MockLogSink, *gomock.Controller, client.Client)
574574
MapObjectFactory func(*GomegaWithT) client.Object
575575
Expect func(*GomegaWithT, []reconcile.Request)
576576
}{
@@ -579,7 +579,8 @@ func Test_azureClusterToAzureMachinePoolsFunc(t *testing.T) {
579579
MapObjectFactory: func(g *GomegaWithT) client.Object {
580580
return newMachinePool("fakeCluster", "bar")
581581
},
582-
Setup: func(g *GomegaWithT, t *testing.T) (*mock_log.MockLogSink, *gomock.Controller, client.Client) {
582+
Setup: func(t *testing.T, g *GomegaWithT) (*mock_log.MockLogSink, *gomock.Controller, client.Client) {
583+
t.Helper()
583584
mockCtrl := gomock.NewController(t)
584585
sink := mock_log.NewMockLogSink(mockCtrl)
585586
fakeClient := fake.NewClientBuilder().WithScheme(newScheme(g)).Build()
@@ -597,7 +598,8 @@ func Test_azureClusterToAzureMachinePoolsFunc(t *testing.T) {
597598
MapObjectFactory: func(g *GomegaWithT) client.Object {
598599
return newAzureCluster("foo")
599600
},
600-
Setup: func(g *GomegaWithT, t *testing.T) (*mock_log.MockLogSink, *gomock.Controller, client.Client) {
601+
Setup: func(t *testing.T, g *GomegaWithT) (*mock_log.MockLogSink, *gomock.Controller, client.Client) {
602+
t.Helper()
601603
mockCtrl := gomock.NewController(t)
602604
sink := mock_log.NewMockLogSink(mockCtrl)
603605
fakeClient := fake.NewClientBuilder().WithScheme(newScheme(g)).Build()
@@ -616,7 +618,8 @@ func Test_azureClusterToAzureMachinePoolsFunc(t *testing.T) {
616618
MapObjectFactory: func(g *GomegaWithT) client.Object {
617619
return newAzureCluster("foo")
618620
},
619-
Setup: func(g *GomegaWithT, t *testing.T) (*mock_log.MockLogSink, *gomock.Controller, client.Client) {
621+
Setup: func(t *testing.T, g *GomegaWithT) (*mock_log.MockLogSink, *gomock.Controller, client.Client) {
622+
t.Helper()
620623
mockCtrl := gomock.NewController(t)
621624
sink := mock_log.NewMockLogSink(mockCtrl)
622625
logWithValues := mock_log.NewMockLogSink(mockCtrl)
@@ -639,7 +642,8 @@ func Test_azureClusterToAzureMachinePoolsFunc(t *testing.T) {
639642
MapObjectFactory: func(g *GomegaWithT) client.Object {
640643
return newAzureCluster("foo")
641644
},
642-
Setup: func(g *GomegaWithT, t *testing.T) (*mock_log.MockLogSink, *gomock.Controller, client.Client) {
645+
Setup: func(t *testing.T, g *GomegaWithT) (*mock_log.MockLogSink, *gomock.Controller, client.Client) {
646+
t.Helper()
643647
mockCtrl := gomock.NewController(t)
644648
sink := mock_log.NewMockLogSink(mockCtrl)
645649
logWithValues := mock_log.NewMockLogSink(mockCtrl)
@@ -664,7 +668,8 @@ func Test_azureClusterToAzureMachinePoolsFunc(t *testing.T) {
664668
MapObjectFactory: func(g *GomegaWithT) client.Object {
665669
return newAzureCluster("foo")
666670
},
667-
Setup: func(g *GomegaWithT, t *testing.T) (*mock_log.MockLogSink, *gomock.Controller, client.Client) {
671+
Setup: func(t *testing.T, g *GomegaWithT) (*mock_log.MockLogSink, *gomock.Controller, client.Client) {
672+
t.Helper()
668673
mockCtrl := gomock.NewController(t)
669674
sink := mock_log.NewMockLogSink(mockCtrl)
670675
logWithValues := mock_log.NewMockLogSink(mockCtrl)
@@ -698,7 +703,7 @@ func Test_azureClusterToAzureMachinePoolsFunc(t *testing.T) {
698703
t.Run(c.Name, func(t *testing.T) {
699704
t.Parallel()
700705
g := NewGomegaWithT(t)
701-
sink, mockctrl, fakeClient := c.Setup(g, t)
706+
sink, mockctrl, fakeClient := c.Setup(t, g)
702707
defer mockctrl.Finish()
703708

704709
f := AzureClusterToAzureMachinePoolsFunc(context.Background(), fakeClient, logr.New(sink))

0 commit comments

Comments
 (0)