Skip to content

Commit c595148

Browse files
authored
Merge pull request #2294 from MrDXY/pr-golangci-sync-nolintlint
🌱 lint: enable nolintlint and fix findings
2 parents 8ec22ab + 6c47a65 commit c595148

32 files changed

+43
-63
lines changed

.golangci.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ linters:
3737
- nakedret
3838
- nilerr
3939
- noctx
40-
# - nolintlint
40+
- nolintlint
4141
- nosprintfhostport
4242
- prealloc
4343
- predeclared
@@ -55,7 +55,11 @@ linters:
5555

5656
linters-settings:
5757
gci:
58-
local-prefixes: "sigs.k8s.io/cluster-api-provider-vsphere"
58+
sections:
59+
- standard # Standard section: captures all standard packages.
60+
- default # Default section: contains all imports that could not be matched to another section type.
61+
- prefix(sigs.k8s.io/cluster-api-provider-vsphere) # Custom section: groups all imports with the specified Prefix.
62+
custom-order: true
5963
godot:
6064
# declarations - for top level declaration comments (default);
6165
# toplevel - for top level comments;

apis/v1alpha3/conversion.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,11 @@ import (
2323
)
2424

2525
// Convert_v1beta1_VirtualMachineCloneSpec_To_v1alpha3_VirtualMachineCloneSpec is an autogenerated conversion function.
26-
//
27-
//nolint:golint,revive,stylecheck
2826
func Convert_v1beta1_VirtualMachineCloneSpec_To_v1alpha3_VirtualMachineCloneSpec(in *v1beta1.VirtualMachineCloneSpec, out *VirtualMachineCloneSpec, s conversion.Scope) error {
2927
return autoConvert_v1beta1_VirtualMachineCloneSpec_To_v1alpha3_VirtualMachineCloneSpec(in, out, s)
3028
}
3129

3230
// Convert_v1beta1_VSphereVMStatus_To_v1alpha3_VSphereVMStatus is an autogenerated conversion function.
33-
//
34-
//nolint:golint,revive,stylecheck
3531
func Convert_v1beta1_VSphereVMStatus_To_v1alpha3_VSphereVMStatus(in *v1beta1.VSphereVMStatus, out *VSphereVMStatus, s conversion.Scope) error {
3632
return autoConvert_v1beta1_VSphereVMStatus_To_v1alpha3_VSphereVMStatus(in, out, s)
3733
}

apis/v1alpha3/vspherecluster_conversion.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17-
//nolint:forcetypeassert,golint,revive,stylecheck
1817
package v1alpha3
1918

2019
import (

apis/v1alpha3/vspheremachine_conversion.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17-
//nolint:forcetypeassert,golint,revive,stylecheck
1817
package v1alpha3
1918

2019
import (

apis/v1alpha3/vspheremachinetemplate_conversion.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17-
//nolint:forcetypeassert,golint,revive,stylecheck
1817
package v1alpha3
1918

2019
import (

apis/v1alpha3/vspherevm_conversion.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17-
//nolint:forcetypeassert,golint,revive,stylecheck
1817
package v1alpha3
1918

2019
import (

apis/v1alpha4/conversion.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ import (
2323
)
2424

2525
// Convert_v1beta1_VirtualMachineCloneSpec_To_v1alpha4_VirtualMachineCloneSpec is an autogenerated conversion function.
26-
//
27-
//nolint:golint,revive,stylecheck
2826
func Convert_v1beta1_VirtualMachineCloneSpec_To_v1alpha4_VirtualMachineCloneSpec(in *infrav1.VirtualMachineCloneSpec, out *VirtualMachineCloneSpec, s conversion.Scope) error {
2927
return autoConvert_v1beta1_VirtualMachineCloneSpec_To_v1alpha4_VirtualMachineCloneSpec(in, out, s)
3028
}

apis/v1alpha4/vspherecluster_conversion.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17-
//nolint:forcetypeassert,golint,revive,stylecheck
1817
package v1alpha4
1918

2019
import (

apis/v1alpha4/vsphereclusteridentity_conversion.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ func (src *VSphereClusterIdentity) ConvertTo(dstRaw conversion.Hub) error {
2929
}
3030

3131
// ConvertFrom converts from the Hub version (v1beta1) to this VSphereClusterIdentity.
32-
func (dst *VSphereClusterIdentity) ConvertFrom(srcRaw conversion.Hub) error { // nolint
32+
func (dst *VSphereClusterIdentity) ConvertFrom(srcRaw conversion.Hub) error {
3333
src := srcRaw.(*infrav1.VSphereClusterIdentity)
3434
return Convert_v1beta1_VSphereClusterIdentity_To_v1alpha4_VSphereClusterIdentity(src, dst, nil)
3535
}
@@ -41,7 +41,7 @@ func (src *VSphereClusterIdentityList) ConvertTo(dstRaw conversion.Hub) error {
4141
}
4242

4343
// ConvertFrom converts this VSphereClusterIdentityList to the Hub version (v1beta1).
44-
func (dst *VSphereClusterIdentityList) ConvertFrom(srcRaw conversion.Hub) error { // nolint
44+
func (dst *VSphereClusterIdentityList) ConvertFrom(srcRaw conversion.Hub) error {
4545
src := srcRaw.(*infrav1.VSphereClusterIdentityList)
4646
return Convert_v1beta1_VSphereClusterIdentityList_To_v1alpha4_VSphereClusterIdentityList(src, dst, nil)
4747
}

apis/v1alpha4/vsphereclusteridentity_types.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17-
//nolint:godot
1817
package v1alpha4
1918

2019
import (

0 commit comments

Comments
 (0)