Skip to content

Commit d459222

Browse files
authored
🌱 (chore): remove unnecessary trailing newlines and redundant blank lines (#4664)
chore: remove unnecessary trailing newlines and redundant blank lines Cleaned up redundant blank lines and unnecessary trailing newlines across various files, including test suites, scaffolds, plugin templates, and documentation scripts. This improves code consistency and reduces visual noise, particularly in generated and test-related files.
1 parent d4fbe38 commit d459222

File tree

27 files changed

+5
-30
lines changed

27 files changed

+5
-30
lines changed

‎hack/docs/internal/cronjob-tutorial/controller_implementation.go‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -536,6 +536,7 @@ var (
536536
apiGVStr = batchv1.GroupVersion.String()
537537
)
538538
`
539+
539540
const controllerSetupWithManager = `
540541
// set up a real clock, since we're not in a test
541542
if r.Clock == nil {

‎hack/docs/internal/cronjob-tutorial/e2e_implementation.go‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ if !isPrometheusOperatorAlreadyInstalled {
4747
_, _ = fmt.Fprintf(GinkgoWriter, "WARNING: Prometheus Operator is already installed. Skipping installation...\n")
4848
}
4949
`
50+
5051
const serviceMonitorE2e = `
5152
5253
By("validating that the ServiceMonitor for Prometheus is applied in the namespace")

‎hack/docs/internal/cronjob-tutorial/generate_cronjob.go‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,6 @@ manifests: controller-gen ## Generate WebhookConfiguration, ClusterRole and Cust
387387
`
388388
err := pluginutil.ReplaceInFile(filepath.Join(sp.ctx.Dir, "Makefile"), originalManifestTarget, changedManifestTarget)
389389
hackutils.CheckError("updating makefile to use maxDescLen=0 in make manifest target", err)
390-
391390
}
392391

393392
func (sp *Sample) updateWebhookTests() {

‎hack/docs/internal/cronjob-tutorial/webhook_implementation.go‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,7 @@ const webhookTestsVars = `var (
313313
validator CronJobCustomValidator
314314
defaulter CronJobCustomDefaulter
315315
)`
316+
316317
const webhookTestsConstants = ` var (
317318
obj *batchv1.CronJob
318319
oldObj *batchv1.CronJob
@@ -322,6 +323,7 @@ const webhookTestsConstants = ` var (
322323
323324
const validCronJobName = "valid-cronjob-name"
324325
const schedule = "*/5 * * * *"`
326+
325327
const webhookTestsBeforeEachOriginal = `obj = &batchv1.CronJob{}
326328
oldObj = &batchv1.CronJob{}
327329
validator = CronJobCustomValidator{}

‎hack/docs/internal/getting-started/generate_getting_started.go‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -430,6 +430,7 @@ const controllerReconcileImplementation = `// Fetch the Memcached instance
430430
log.Error(err, "Failed to update Memcached status")
431431
return ctrl.Result{}, err
432432
}`
433+
433434
const controllerDeploymentFunc = `// deploymentForMemcached returns a Memcached Deployment object
434435
func (r *MemcachedReconciler) deploymentForMemcached(
435436
memcached *cachev1alpha1.Memcached) (*appsv1.Deployment, error) {

‎hack/docs/internal/multiversion-tutorial/generate_multiversion.go‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -658,7 +658,6 @@ CronJob controller's `+"`SetupWithManager`"+` method.
658658
`// +kubebuilder:docs-gen:collapse=existing setup`,
659659
)
660660
hackutils.CheckError("replace +kubebuilder:docs-gen:collapse=old stuff main.go", err)
661-
662661
}
663662

664663
func (sp *Sample) updateAPIV2() {

‎pkg/cli/cli_test.go‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,6 @@ plugins:
467467
printed, _ := io.ReadAll(r)
468468
Expect(string(printed)).To(Equal(
469469
fmt.Sprintf("%s\n", version)))
470-
471470
})
472471
})
473472

‎pkg/cli/completion_test.go‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,5 @@ var _ = Describe("Completion", func() {
7878
Expect(cmd.Short).NotTo(Equal(""))
7979
Expect(cmd.Short).To(ContainSubstring("Load powershell completions"))
8080
})
81-
8281
})
8382
})

‎pkg/plugin/bundle.go‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ func WithDeprecationMessage(msg string) BundleOption {
6060
return func(opts *bundle) {
6161
opts.deprecateWarning = msg
6262
}
63-
6463
}
6564

6665
// NewBundleWithOptions creates a new Bundle with the provided BundleOptions.

‎pkg/plugins/common/kustomize/v2/create.go‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ func (p *createSubcommand) configure() (err error) {
5252
if p.force, err = strconv.ParseBool(forceFlag.Value.String()); err != nil {
5353
return err
5454
}
55-
5655
}
5756
return nil
5857
}

0 commit comments

Comments
 (0)