diff --git a/.golangci.yml b/.golangci.yml index 2adedd46ec..75dd443506 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -37,7 +37,7 @@ linters: - nakedret - nilerr - noctx - # - nolintlint + - nolintlint - nosprintfhostport - prealloc - predeclared diff --git a/apis/v1alpha4/conversion.go b/apis/v1alpha4/conversion.go index 48239de1ef..47a7326696 100644 --- a/apis/v1alpha4/conversion.go +++ b/apis/v1alpha4/conversion.go @@ -24,7 +24,7 @@ import ( // Convert_v1beta1_VirtualMachineCloneSpec_To_v1alpha4_VirtualMachineCloneSpec is an autogenerated conversion function. // -//nolint:golint,revive,stylecheck +//nolint:golint func Convert_v1beta1_VirtualMachineCloneSpec_To_v1alpha4_VirtualMachineCloneSpec(in *infrav1.VirtualMachineCloneSpec, out *VirtualMachineCloneSpec, s conversion.Scope) error { return autoConvert_v1beta1_VirtualMachineCloneSpec_To_v1alpha4_VirtualMachineCloneSpec(in, out, s) } diff --git a/apis/v1alpha4/vspherecluster_conversion.go b/apis/v1alpha4/vspherecluster_conversion.go index 2f7546d717..3d7c64bbed 100644 --- a/apis/v1alpha4/vspherecluster_conversion.go +++ b/apis/v1alpha4/vspherecluster_conversion.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -//nolint:forcetypeassert,golint,revive,stylecheck +//nolint:forcetypeassert,golint package v1alpha4 import ( diff --git a/apis/v1alpha4/vsphereclusteridentity_conversion.go b/apis/v1alpha4/vsphereclusteridentity_conversion.go index ccb227e7b4..b6499ddc7c 100644 --- a/apis/v1alpha4/vsphereclusteridentity_conversion.go +++ b/apis/v1alpha4/vsphereclusteridentity_conversion.go @@ -29,7 +29,7 @@ func (src *VSphereClusterIdentity) ConvertTo(dstRaw conversion.Hub) error { } // ConvertFrom converts from the Hub version (v1beta1) to this VSphereClusterIdentity. -func (dst *VSphereClusterIdentity) ConvertFrom(srcRaw conversion.Hub) error { // nolint +func (dst *VSphereClusterIdentity) ConvertFrom(srcRaw conversion.Hub) error { src := srcRaw.(*infrav1.VSphereClusterIdentity) return Convert_v1beta1_VSphereClusterIdentity_To_v1alpha4_VSphereClusterIdentity(src, dst, nil) } @@ -41,7 +41,7 @@ func (src *VSphereClusterIdentityList) ConvertTo(dstRaw conversion.Hub) error { } // ConvertFrom converts this VSphereClusterIdentityList to the Hub version (v1beta1). -func (dst *VSphereClusterIdentityList) ConvertFrom(srcRaw conversion.Hub) error { // nolint +func (dst *VSphereClusterIdentityList) ConvertFrom(srcRaw conversion.Hub) error { src := srcRaw.(*infrav1.VSphereClusterIdentityList) return Convert_v1beta1_VSphereClusterIdentityList_To_v1alpha4_VSphereClusterIdentityList(src, dst, nil) } diff --git a/apis/v1alpha4/vsphereclusteridentity_types.go b/apis/v1alpha4/vsphereclusteridentity_types.go index 223c95fc85..4217a78673 100644 --- a/apis/v1alpha4/vsphereclusteridentity_types.go +++ b/apis/v1alpha4/vsphereclusteridentity_types.go @@ -14,7 +14,6 @@ See the License for the specific language governing permissions and limitations under the License. */ -//nolint:godot package v1alpha4 import ( diff --git a/apis/v1alpha4/vsphereclustertemplate_conversion.go b/apis/v1alpha4/vsphereclustertemplate_conversion.go index 499cb90b15..7736da4d27 100644 --- a/apis/v1alpha4/vsphereclustertemplate_conversion.go +++ b/apis/v1alpha4/vsphereclustertemplate_conversion.go @@ -29,7 +29,7 @@ func (src *VSphereClusterTemplate) ConvertTo(dstRaw conversion.Hub) error { } // ConvertFrom converts from the Hub version (v1beta1) to this VSphereClusterTemplate. -func (dst *VSphereClusterTemplate) ConvertFrom(srcRaw conversion.Hub) error { // nolint +func (dst *VSphereClusterTemplate) ConvertFrom(srcRaw conversion.Hub) error { src := srcRaw.(*infrav1.VSphereClusterTemplate) return Convert_v1beta1_VSphereClusterTemplate_To_v1alpha4_VSphereClusterTemplate(src, dst, nil) } @@ -41,7 +41,7 @@ func (src *VSphereClusterTemplateList) ConvertTo(dstRaw conversion.Hub) error { } // ConvertFrom converts this VSphereClusterIdentityList to the Hub version (v1beta1). -func (dst *VSphereClusterTemplateList) ConvertFrom(srcRaw conversion.Hub) error { // nolint +func (dst *VSphereClusterTemplateList) ConvertFrom(srcRaw conversion.Hub) error { src := srcRaw.(*infrav1.VSphereClusterTemplateList) return Convert_v1beta1_VSphereClusterTemplateList_To_v1alpha4_VSphereClusterTemplateList(src, dst, nil) } diff --git a/apis/v1alpha4/vspheredeploymentzone_conversion.go b/apis/v1alpha4/vspheredeploymentzone_conversion.go index 85fe22028b..857fc6e741 100644 --- a/apis/v1alpha4/vspheredeploymentzone_conversion.go +++ b/apis/v1alpha4/vspheredeploymentzone_conversion.go @@ -29,7 +29,7 @@ func (src *VSphereDeploymentZone) ConvertTo(dstRaw conversion.Hub) error { } // ConvertFrom converts from the Hub version (v1beta1) to this VSphereDeploymentZone. -func (dst *VSphereDeploymentZone) ConvertFrom(srcRaw conversion.Hub) error { // nolint +func (dst *VSphereDeploymentZone) ConvertFrom(srcRaw conversion.Hub) error { src := srcRaw.(*infrav1.VSphereDeploymentZone) return Convert_v1beta1_VSphereDeploymentZone_To_v1alpha4_VSphereDeploymentZone(src, dst, nil) } @@ -41,7 +41,7 @@ func (src *VSphereDeploymentZoneList) ConvertTo(dstRaw conversion.Hub) error { } // ConvertFrom converts this VSphereDeploymentZoneList to the Hub version (v1beta1). -func (dst *VSphereDeploymentZoneList) ConvertFrom(srcRaw conversion.Hub) error { // nolint +func (dst *VSphereDeploymentZoneList) ConvertFrom(srcRaw conversion.Hub) error { src := srcRaw.(*infrav1.VSphereDeploymentZoneList) return Convert_v1beta1_VSphereDeploymentZoneList_To_v1alpha4_VSphereDeploymentZoneList(src, dst, nil) } diff --git a/apis/v1alpha4/vspherefailuredomain_conversion.go b/apis/v1alpha4/vspherefailuredomain_conversion.go index c1279e520b..006033f971 100644 --- a/apis/v1alpha4/vspherefailuredomain_conversion.go +++ b/apis/v1alpha4/vspherefailuredomain_conversion.go @@ -29,7 +29,7 @@ func (src *VSphereFailureDomain) ConvertTo(dstRaw conversion.Hub) error { } // ConvertFrom converts from the Hub version (v1beta1) to this VSphereFailureDomain. -func (dst *VSphereFailureDomain) ConvertFrom(srcRaw conversion.Hub) error { // nolint +func (dst *VSphereFailureDomain) ConvertFrom(srcRaw conversion.Hub) error { src := srcRaw.(*infrav1.VSphereFailureDomain) return Convert_v1beta1_VSphereFailureDomain_To_v1alpha4_VSphereFailureDomain(src, dst, nil) } @@ -41,7 +41,7 @@ func (src *VSphereFailureDomainList) ConvertTo(dstRaw conversion.Hub) error { } // ConvertFrom converts this VSphereFailureDomainList to the Hub version (v1beta1). -func (dst *VSphereFailureDomainList) ConvertFrom(srcRaw conversion.Hub) error { // nolint +func (dst *VSphereFailureDomainList) ConvertFrom(srcRaw conversion.Hub) error { src := srcRaw.(*infrav1.VSphereFailureDomainList) return Convert_v1beta1_VSphereFailureDomainList_To_v1alpha4_VSphereFailureDomainList(src, dst, nil) } diff --git a/apis/v1alpha4/vspheremachine_conversion.go b/apis/v1alpha4/vspheremachine_conversion.go index 4320ccb997..2b8f719e21 100644 --- a/apis/v1alpha4/vspheremachine_conversion.go +++ b/apis/v1alpha4/vspheremachine_conversion.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -//nolint:forcetypeassert,golint,revive,stylecheck +//nolint:forcetypeassert,golint package v1alpha4 import ( diff --git a/apis/v1alpha4/vspheremachinetemplate_conversion.go b/apis/v1alpha4/vspheremachinetemplate_conversion.go index 0061d79fc3..47eacca51e 100644 --- a/apis/v1alpha4/vspheremachinetemplate_conversion.go +++ b/apis/v1alpha4/vspheremachinetemplate_conversion.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -//nolint:golint,revive,stylecheck +//nolint:golint package v1alpha4 import ( @@ -76,14 +76,12 @@ func (dst *VSphereMachineTemplateList) ConvertFrom(srcRaw conversion.Hub) error return Convert_v1beta1_VSphereMachineTemplateList_To_v1alpha4_VSphereMachineTemplateList(src, dst, nil) } -// nolint func Convert_v1alpha4_ObjectMeta_To_v1beta1_ObjectMeta(in *clusterv1alpha4.ObjectMeta, out *clusterv1.ObjectMeta, s apiconversion.Scope) error { // wrapping the conversion func to avoid having compile errors due to compileErrorOnMissingConversion() // more details at https://github.com/kubernetes/kubernetes/issues/98380 return clusterv1alpha4.Convert_v1alpha4_ObjectMeta_To_v1beta1_ObjectMeta(in, out, s) } -// nolint func Convert_v1beta1_ObjectMeta_To_v1alpha4_ObjectMeta(in *clusterv1.ObjectMeta, out *clusterv1alpha4.ObjectMeta, s apiconversion.Scope) error { // wrapping the conversion func to avoid having compile errors due to compileErrorOnMissingConversion() // more details at https://github.com/kubernetes/kubernetes/issues/98380 diff --git a/apis/v1alpha4/vspherevm_conversion.go b/apis/v1alpha4/vspherevm_conversion.go index a2eece0b41..d5d6d5bc14 100644 --- a/apis/v1alpha4/vspherevm_conversion.go +++ b/apis/v1alpha4/vspherevm_conversion.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -//nolint:forcetypeassert,golint,revive,stylecheck +//nolint:forcetypeassert,golint package v1alpha4 import ( diff --git a/apis/v1beta1/vspheremachine_webhook_test.go b/apis/v1beta1/vspheremachine_webhook_test.go index 5fcc2d3085..0d288c5518 100644 --- a/apis/v1beta1/vspheremachine_webhook_test.go +++ b/apis/v1beta1/vspheremachine_webhook_test.go @@ -35,9 +35,7 @@ func TestVsphereMachine_Default(t *testing.T) { g.Expect(m.Spec.Datacenter).To(Equal("*")) } -//nolint:all func TestVSphereMachine_ValidateCreate(t *testing.T) { - g := NewWithT(t) tests := []struct { name string @@ -107,9 +105,7 @@ func TestVSphereMachine_ValidateCreate(t *testing.T) { } } -//nolint:all func TestVSphereMachine_ValidateUpdate(t *testing.T) { - g := NewWithT(t) tests := []struct { diff --git a/controllers/vmware/test/controllers_suite_test.go b/controllers/vmware/test/controllers_suite_test.go index a871506337..76b0f591e2 100644 --- a/controllers/vmware/test/controllers_suite_test.go +++ b/controllers/vmware/test/controllers_suite_test.go @@ -65,7 +65,7 @@ func getTestEnv() (*envtest.Environment, *rest.Config) { utilruntime.Must(vmwarev1.AddToScheme(scheme.Scheme)) // Get the root of the current file to use in CRD paths. - _, filename, _, _ := goruntime.Caller(0) //nolint + _, filename, _, _ := goruntime.Caller(0) //nolint:dogsled root := path.Join(path.Dir(filename), "..", "..", "..") localTestEnv := &envtest.Environment{ diff --git a/pkg/identity/identity_suite_test.go b/pkg/identity/identity_suite_test.go index ed4b1709bf..d82de82978 100644 --- a/pkg/identity/identity_suite_test.go +++ b/pkg/identity/identity_suite_test.go @@ -53,7 +53,7 @@ func init() { utilruntime.Must(infrav1.AddToScheme(scheme)) utilruntime.Must(infrav1alpha3.AddToScheme(scheme)) - _, filename, _, _ := goruntime.Caller(0) //nolint + _, filename, _, _ := goruntime.Caller(0) //nolint:dogsled root := path.Join(path.Dir(filename), "..", "..") crdPaths := []string{ diff --git a/pkg/services/govmomi/vcenter/clone_test.go b/pkg/services/govmomi/vcenter/clone_test.go index cf1c3e9c10..addee498c5 100644 --- a/pkg/services/govmomi/vcenter/clone_test.go +++ b/pkg/services/govmomi/vcenter/clone_test.go @@ -16,7 +16,7 @@ limitations under the License. package vcenter -//nolint:all +//nolint:goimports import ( ctx "context" "crypto/tls" @@ -24,7 +24,6 @@ import ( "github.com/vmware/govmomi/object" "github.com/vmware/govmomi/simulator" - // run init func to register the tagging API endpoints. _ "github.com/vmware/govmomi/vapi/simulator" "github.com/vmware/govmomi/vim25/types" diff --git a/test/helpers/envtest.go b/test/helpers/envtest.go index 74dc145b2e..094630d206 100644 --- a/test/helpers/envtest.go +++ b/test/helpers/envtest.go @@ -75,7 +75,7 @@ func init() { utilruntime.Must(infrav1.AddToScheme(scheme)) // Get the root of the current file to use in CRD paths. - _, filename, _, _ := goruntime.Caller(0) //nolint + _, filename, _, _ := goruntime.Caller(0) //nolint:dogsled root := path.Join(path.Dir(filename), "..", "..") crdPaths := []string{ diff --git a/test/helpers/vcsim/simulator.go b/test/helpers/vcsim/simulator.go index 4ec3e41536..edbbae8901 100644 --- a/test/helpers/vcsim/simulator.go +++ b/test/helpers/vcsim/simulator.go @@ -16,14 +16,13 @@ limitations under the License. package vcsim -//nolint:all +//nolint:goimports import ( "fmt" "net/url" "github.com/onsi/gomega/gbytes" "github.com/vmware/govmomi/simulator" - // run init func to register the tagging API endpoints. _ "github.com/vmware/govmomi/vapi/simulator" ) diff --git a/test/helpers/webhook.go b/test/helpers/webhook.go index 1d1d0248bf..95cbfbd292 100644 --- a/test/helpers/webhook.go +++ b/test/helpers/webhook.go @@ -79,7 +79,7 @@ func appendWebhookConfiguration(configyamlFile []byte, tag string) ([]*v1.Mutati func initializeWebhookInEnvironment() { // Get the root of the current file to use in CRD paths. - _, filename, _, _ := goruntime.Caller(0) //nolint + _, filename, _, _ := goruntime.Caller(0) //nolint:dogsled root := path.Join(path.Dir(filename), "..", "..") configyamlFile, err := os.ReadFile(filepath.Join(root, "config", "webhook", "manifests.yaml")) if err != nil {