From 7a0e41c045228703977df8d32d9c1783f14b365b Mon Sep 17 00:00:00 2001 From: Kelly Merrick Date: Wed, 13 Dec 2023 15:22:09 -0600 Subject: [PATCH] chore(linter): fix linter errors, remove deprecated allow leading spaces (#165) --- .golangci.yml | 3 +-- cmd/vela-kubernetes/apply_test.go | 6 +++--- cmd/vela-kubernetes/command_test.go | 2 +- cmd/vela-kubernetes/patch_test.go | 2 +- cmd/vela-kubernetes/status_test.go | 2 +- 5 files changed, 7 insertions(+), 8 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 44382f6..801b39d 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -42,8 +42,7 @@ linters-settings: locale: US # https://github.com/golangci/golangci-lint/blob/master/pkg/golinters/nolintlint - nolintlint: - allow-leading-space: true # allow non-"machine-readable" format (ie. with leading space) + nolintlint: allow-unused: false # allow nolint directives that don't address a linting issue require-explanation: true # require an explanation for nolint directives require-specific: true # require nolint directives to be specific about which linter is being skipped diff --git a/cmd/vela-kubernetes/apply_test.go b/cmd/vela-kubernetes/apply_test.go index 1af13b1..7dec1e2 100644 --- a/cmd/vela-kubernetes/apply_test.go +++ b/cmd/vela-kubernetes/apply_test.go @@ -26,7 +26,7 @@ func TestKubernetes_Apply_Command(t *testing.T) { Output: "json", } - // nolint: gosec // testing purposes + //nolint:gosec // testing purposes for _, file := range a.Files { want := exec.Command( _kubectl, @@ -64,7 +64,7 @@ func TestKubernetes_Apply_Command_WithDryRunTrue(t *testing.T) { Output: "json", } - // nolint: gosec // testing purposes + //nolint:gosec // testing purposes for _, file := range a.Files { want := exec.Command( _kubectl, @@ -102,7 +102,7 @@ func TestKubernetes_Apply_Command_WithDryRunAnythingNonBoolean(t *testing.T) { Output: "json", } - // nolint: gosec // testing purposes + //nolint:gosec // testing purposes for _, file := range a.Files { want := exec.Command( _kubectl, diff --git a/cmd/vela-kubernetes/command_test.go b/cmd/vela-kubernetes/command_test.go index 3ca9198..d06392f 100644 --- a/cmd/vela-kubernetes/command_test.go +++ b/cmd/vela-kubernetes/command_test.go @@ -30,7 +30,7 @@ func TestKubernetes_versionCmd(t *testing.T) { Path: "~/.kube/config", } - // nolint: gosec // testing purposes + //nolint:gosec // testing purposes want := exec.Command( _kubectl, fmt.Sprintf("--kubeconfig=%s", c.Path), diff --git a/cmd/vela-kubernetes/patch_test.go b/cmd/vela-kubernetes/patch_test.go index 9d33a9e..a8eb8f6 100644 --- a/cmd/vela-kubernetes/patch_test.go +++ b/cmd/vela-kubernetes/patch_test.go @@ -33,7 +33,7 @@ func TestKubernetes_Patch_Command(t *testing.T) { RawContainers: `[{"name": "container", "image": "alpine"}]`, } - // nolint: gosec // testing purposes + //nolint:gosec // testing purposes for _, file := range p.Files { for _, container := range p.Containers { pattern := fmt.Sprintf(patchPattern, container.Name, container.Image) diff --git a/cmd/vela-kubernetes/status_test.go b/cmd/vela-kubernetes/status_test.go index 59e29b3..d85ab04 100644 --- a/cmd/vela-kubernetes/status_test.go +++ b/cmd/vela-kubernetes/status_test.go @@ -27,7 +27,7 @@ func TestKubernetes_Status_Command(t *testing.T) { Watch: true, } - // nolint: gosec // testing purposes + //nolint:gosec // testing purposes for _, resource := range s.Resources { want := exec.Command( _kubectl,