Skip to content

Commit

Permalink
Fix linting errors (#1655)
Browse files Browse the repository at this point in the history
* Fix formatting and function length linting errors

The test function for `GetContent` is deliberately long, as it contains
a slice modeling all test cases.

* Fix empty returns

This fixes a couple of linter errors for empty returns.
  • Loading branch information
weyfonk authored Jul 18, 2023
1 parent 601af18 commit 53eee09
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
1 change: 0 additions & 1 deletion e2e/single-cluster/gitrepo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,6 @@ var _ = Describe("Monitoring Git repos via HTTP for change", Label("infra-setup"
Expect(err).ToNot(HaveOccurred())
})


It("updates the deployment", func() {
By("checking the pod exists")
Eventually(func() string {
Expand Down
1 change: 1 addition & 0 deletions internal/bundlereader/loaddirectory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ type fsNode struct {
isDir bool
}

// nolint: funlen
func TestGetContent(t *testing.T) {
cases := []struct {
name string
Expand Down
6 changes: 3 additions & 3 deletions internal/cmd/agent/deployer/monitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ func modified(plan apply.Plan, resourcesPreviousRelease *helmdeployer.Resources)
for gvk, keys := range plan.Create {
for _, key := range keys {
if len(result) >= 10 {
return
return result
}

apiVersion, kind := gvk.ToAPIVersionAndKind()
Expand All @@ -250,7 +250,7 @@ func modified(plan apply.Plan, resourcesPreviousRelease *helmdeployer.Resources)
for gvk, keys := range plan.Delete {
for _, key := range keys {
if len(result) >= 10 {
return
return result
}

apiVersion, kind := gvk.ToAPIVersionAndKind()
Expand Down Expand Up @@ -310,7 +310,7 @@ func nonReady(plan apply.Plan, ignoreOptions fleet.IgnoreOptions) (result []flee

for _, obj := range plan.Objects {
if len(result) >= 10 {
return
return result
}
if u, ok := obj.(*unstructured.Unstructured); ok {
if ignoreOptions.Conditions != nil {
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/controller/target/target.go
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ func preprocessHelmValues(opts *fleet.BundleDeploymentOptions, cluster *fleet.Cl
}
}
if len(clusterLabels) == 0 {
return
return nil
}

if opts.Helm == nil {
Expand Down

0 comments on commit 53eee09

Please sign in to comment.