Skip to content

Commit

Permalink
Enforce package docstring format linting
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
stmcginnis committed May 19, 2021
1 parent 0c47535 commit c86f259
Show file tree
Hide file tree
Showing 22 changed files with 69 additions and 14 deletions.
1 change: 0 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ issues:
- Error return value of .((os\.)?std(out|err)\..*|.*Close|.*Flush|os\.Remove(All)?|.*print(f|ln)?|os\.(Un)?Setenv). is not checked
# The following are being worked on to remove their exclusion. This list should be reduced or go away all together over time.
# If it is decided they will not be addressed they should be moved above this comment.
- package comment should be of the form "Package (.+) ..."
- Subprocess launch(ed with variable|ing should be audited)
- (Expect directory permissions to be 0750 or less|Expect file permissions to be 0600 or less)
- (G104|G307)
Expand Down
1 change: 1 addition & 0 deletions api/v1alpha3/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

// Package v1alpha3 contains the v1alpha3 API implementation.
// +k8s:conversion-gen=sigs.k8s.io/cluster-api/api/v1alpha4
package v1alpha3
1 change: 1 addition & 0 deletions bootstrap/kubeadm/api/v1alpha3/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

// Package v1alpha3 contains the v1alpha3 API implementation.
// +k8s:conversion-gen=sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1alpha4
package v1alpha3
18 changes: 18 additions & 0 deletions bootstrap/kubeadm/types/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/*
Copyright 2021 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

// Package utils contains Kubeadm utility types.
package utils
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

/*
package bootstrap defines the types for a generic bootstrap provider used for tests
*/
package bootstrap

import (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

// Package bootstrap defines the types for a generic bootstrap provider used for tests.
// +kubebuilder:object:generate=true
// +groupName=bootstrap.cluster.x-k8s.io
package bootstrap
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

/*
package controlplane defines the types for a generic control plane provider used for tests
*/
package controlplane

import (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

// Package controlplane defines the types for a generic control plane provider used for tests.
// +kubebuilder:object:generate=true
// +groupName=controlplane.cluster.x-k8s.io
package controlplane
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

/*
package external defines the types for a generic external provider used for tests
*/
package external

import (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

// Package external defines the types for a generic external provider used for tests.
// +kubebuilder:object:generate=true
// +groupName=custom.cluster.x-k8s.io
package external
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

/*
package infrastructure defines the types for a generic infrastructure provider used for tests
*/
package infrastructure

import (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

// Package infrastructure defines the types for a generic infrastructure provider used for tests.
// +kubebuilder:object:generate=true
// +groupName=infrastructure.cluster.x-k8s.io
package infrastructure
Expand Down
18 changes: 18 additions & 0 deletions controllers/mdutil/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/*
Copyright 2021 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

// Package mdutil implements MachineDeployment utilities.
package mdutil
2 changes: 1 addition & 1 deletion controllers/mdutil/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -702,7 +702,7 @@ func DeepHashObject(hasher hash.Hash, objectToWrite interface{}) {
DisableMethods: true,
SpewKeys: true,
}
_, _ = printer.Fprintf(hasher, "%#v", objectToWrite)
printer.Fprintf(hasher, "%#v", objectToWrite)
}

func ComputeHash(template *clusterv1.MachineTemplateSpec) uint32 {
Expand Down
1 change: 1 addition & 0 deletions controlplane/kubeadm/api/v1alpha3/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

// Package v1alpha3 contains the v1alpha3 API implementation.
// +k8s:conversion-gen=sigs.k8s.io/cluster-api/controlplane/kubeadm/api/v1alpha4
package v1alpha3
1 change: 1 addition & 0 deletions exp/addons/api/v1alpha3/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

// Package v1alpha3 contains the v1alpha3 API implementation.
// +k8s:conversion-gen=sigs.k8s.io/cluster-api/exp/addons/api/v1alpha4
package v1alpha3
1 change: 1 addition & 0 deletions exp/api/v1alpha3/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

// Package v1alpha3 contains the v1alpha3 API implementation.
// +k8s:conversion-gen=sigs.k8s.io/cluster-api/exp/api/v1alpha4
package v1alpha3
18 changes: 18 additions & 0 deletions exp/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/*
Copyright 2019 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

// Package exp implements experimental code.
package exp
2 changes: 2 additions & 0 deletions hack/boilerplate/test/fail.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
/*
Copyright 2014 The Kubernetes Authors.
fail
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
Expand Down
1 change: 1 addition & 0 deletions test/infrastructure/docker/api/v1alpha3/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

// Package v1alpha3 contains the v1alpha3 API implementation.
// +k8s:conversion-gen=sigs.k8s.io/cluster-api/test/infrastructure/docker/api/v1alpha4
package v1alpha3
1 change: 1 addition & 0 deletions test/infrastructure/docker/exp/api/v1alpha3/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

// Package v1alpha3 contains the v1alpha3 API implementation.
// +k8s:conversion-gen=sigs.k8s.io/cluster-api/test/infrastructure/docker/exp/api/v1alpha4
package v1alpha3
1 change: 1 addition & 0 deletions util/conditions/unstructured.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package conditions

import (
Expand Down

0 comments on commit c86f259

Please sign in to comment.