Skip to content

Commit 36dd674

Browse files
committed
Enforce package docstring format linting
This removes the linting exclusion to make sure package godoc strings are in the expected format of "Package x...". Signed-off-by: Sean McGinnis <[email protected]>
1 parent 6e85f96 commit 36dd674

File tree

22 files changed

+69
-14
lines changed

22 files changed

+69
-14
lines changed

.golangci.yml

-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ issues:
4848
- Error return value of .((os\.)?std(out|err)\..*|.*Close|.*Flush|os\.Remove(All)?|.*print(f|ln)?|os\.(Un)?Setenv). is not checked
4949
# The following are being worked on to remove their exclusion. This list should be reduced or go away all together over time.
5050
# If it is decided they will not be addressed they should be moved above this comment.
51-
- package comment should be of the form "Package (.+) ..."
5251
- Subprocess launch(ed with variable|ing should be audited)
5352
- (Expect directory permissions to be 0750 or less|Expect file permissions to be 0600 or less)
5453
- (G104|G307)

api/v1alpha3/doc.go

+1
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,6 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17+
// Package v1alpha3 contains the v1alpha3 API implementation.
1718
// +k8s:conversion-gen=sigs.k8s.io/cluster-api/api/v1alpha4
1819
package v1alpha3

bootstrap/kubeadm/api/v1alpha3/doc.go

+1
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,6 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17+
// Package v1alpha3 contains the v1alpha3 API implementation.
1718
// +k8s:conversion-gen=sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1alpha4
1819
package v1alpha3

bootstrap/kubeadm/types/doc.go

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/*
2+
Copyright 2021 The Kubernetes Authors.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
// Package utils contains Kubeadm utility types.
18+
package utils

cmd/clusterctl/internal/test/providers/bootstrap/generic_types.go

-3
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17-
/*
18-
package bootstrap defines the types for a generic bootstrap provider used for tests
19-
*/
2017
package bootstrap
2118

2219
import (

cmd/clusterctl/internal/test/providers/bootstrap/groupversion_info.go

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

17+
// Package bootstrap defines the types for a generic bootstrap provider used for tests.
1718
// +kubebuilder:object:generate=true
1819
// +groupName=bootstrap.cluster.x-k8s.io
1920
package bootstrap

cmd/clusterctl/internal/test/providers/controlplane/generic_types.go

-3
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17-
/*
18-
package controlplane defines the types for a generic control plane provider used for tests
19-
*/
2017
package controlplane
2118

2219
import (

cmd/clusterctl/internal/test/providers/controlplane/groupversion_info.go

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

17+
// Package controlplane defines the types for a generic control plane provider used for tests.
1718
// +kubebuilder:object:generate=true
1819
// +groupName=controlplane.cluster.x-k8s.io
1920
package controlplane

cmd/clusterctl/internal/test/providers/external/generic_types.go

-3
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17-
/*
18-
package external defines the types for a generic external provider used for tests
19-
*/
2017
package external
2118

2219
import (

cmd/clusterctl/internal/test/providers/external/groupversion_info.go

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

17+
// Package external defines the types for a generic external provider used for tests.
1718
// +kubebuilder:object:generate=true
1819
// +groupName=custom.cluster.x-k8s.io
1920
package external

cmd/clusterctl/internal/test/providers/infrastructure/generic_types.go

-3
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17-
/*
18-
package infrastructure defines the types for a generic infrastructure provider used for tests
19-
*/
2017
package infrastructure
2118

2219
import (

cmd/clusterctl/internal/test/providers/infrastructure/groupversion_info.go

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

17+
// Package infrastructure defines the types for a generic infrastructure provider used for tests.
1718
// +kubebuilder:object:generate=true
1819
// +groupName=infrastructure.cluster.x-k8s.io
1920
package infrastructure

controllers/mdutil/doc.go

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/*
2+
Copyright 2021 The Kubernetes Authors.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
// Package mdutil implements MachineDeployment utilities.
18+
package mdutil

controllers/mdutil/util.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -702,7 +702,7 @@ func DeepHashObject(hasher hash.Hash, objectToWrite interface{}) {
702702
DisableMethods: true,
703703
SpewKeys: true,
704704
}
705-
_, _ = printer.Fprintf(hasher, "%#v", objectToWrite)
705+
printer.Fprintf(hasher, "%#v", objectToWrite)
706706
}
707707

708708
func ComputeHash(template *clusterv1.MachineTemplateSpec) uint32 {

controlplane/kubeadm/api/v1alpha3/doc.go

+1
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,6 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17+
// Package v1alpha3 contains the v1alpha3 API implementation.
1718
// +k8s:conversion-gen=sigs.k8s.io/cluster-api/controlplane/kubeadm/api/v1alpha4
1819
package v1alpha3

exp/addons/api/v1alpha3/doc.go

+1
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,6 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17+
// Package v1alpha3 contains the v1alpha3 API implementation.
1718
// +k8s:conversion-gen=sigs.k8s.io/cluster-api/exp/addons/api/v1alpha4
1819
package v1alpha3

exp/api/v1alpha3/doc.go

+1
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,6 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17+
// Package v1alpha3 contains the v1alpha3 API implementation.
1718
// +k8s:conversion-gen=sigs.k8s.io/cluster-api/exp/api/v1alpha4
1819
package v1alpha3

exp/doc.go

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/*
2+
Copyright 2019 The Kubernetes Authors.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
// Package exp implements experimental code.
18+
package exp

hack/boilerplate/test/fail.go

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
/*
22
Copyright 2014 The Kubernetes Authors.
33
4+
fail
5+
46
Licensed under the Apache License, Version 2.0 (the "License");
57
you may not use this file except in compliance with the License.
68
You may obtain a copy of the License at

test/infrastructure/docker/api/v1alpha3/doc.go

+1
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,6 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17+
// Package v1alpha3 contains the v1alpha3 API implementation.
1718
// +k8s:conversion-gen=sigs.k8s.io/cluster-api/test/infrastructure/docker/api/v1alpha4
1819
package v1alpha3

test/infrastructure/docker/exp/api/v1alpha3/doc.go

+1
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,6 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17+
// Package v1alpha3 contains the v1alpha3 API implementation.
1718
// +k8s:conversion-gen=sigs.k8s.io/cluster-api/test/infrastructure/docker/exp/api/v1alpha4
1819
package v1alpha3

util/conditions/unstructured.go

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1313
See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
16+
1617
package conditions
1718

1819
import (

0 commit comments

Comments
 (0)