From 9c50be74feb3cf7407bcaccfa0500c09297fb880 Mon Sep 17 00:00:00 2001 From: Kelly Merrick Date: Wed, 13 Dec 2023 15:15:51 -0600 Subject: [PATCH] chore(linter): fix linter errors, remove deprecated allow leading spaces (#57) * chore(linter): fix linter errors, remove deprecated allow leading spaces * chore(codeql): remove toolchain in go.mod to pass --- .golangci.yml | 1 - go.mod | 2 -- internal/npm/plugin_test.go | 14 +++++++------- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 99eb052..1d15199 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -43,7 +43,6 @@ linters-settings: # 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) 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/go.mod b/go.mod index a055a07..82c0c1a 100644 --- a/go.mod +++ b/go.mod @@ -2,8 +2,6 @@ module github.com/go-vela/vela-npm go 1.21 -toolchain go1.21.5 - require ( github.com/Masterminds/semver/v3 v3.2.1 github.com/go-vela/types v0.22.0 diff --git a/internal/npm/plugin_test.go b/internal/npm/plugin_test.go index c08ce63..aaf25dd 100644 --- a/internal/npm/plugin_test.go +++ b/internal/npm/plugin_test.go @@ -109,7 +109,7 @@ func TestPlugin_createNpmrc_CreatesFile(t *testing.T) { } p, mock, fs := createTestPlugin(t, c) home := path.Join("usr", "mctestface") - fs.MkdirAll(home, 0755) // nolint: errcheck // testing + fs.MkdirAll(home, 0755) //nolint:errcheck // testing mock. EXPECT(). GetHomeDir(). @@ -141,7 +141,7 @@ func TestPlugin_createNpmrc_AuthToken(t *testing.T) { } p, mock, fs := createTestPlugin(t, c) home := path.Join("usr", "mctestface") - fs.MkdirAll(home, 0755) // nolint: errcheck // testing + fs.MkdirAll(home, 0755) //nolint:errcheck // testing mock. EXPECT(). GetHomeDir(). @@ -174,7 +174,7 @@ func TestPlugin_createNpmrc_Registry(t *testing.T) { } p, mock, fs := createTestPlugin(t, c) home := path.Join("usr", "mctestface") - fs.MkdirAll(home, 0755) // nolint: errcheck // testing + fs.MkdirAll(home, 0755) //nolint:errcheck // testing mock. EXPECT(). GetHomeDir(). @@ -208,7 +208,7 @@ func TestPlugin_createNpmrc_Email(t *testing.T) { } p, mock, fs := createTestPlugin(t, c) home := path.Join("usr", "mctestface") - fs.MkdirAll(home, 0755) // nolint: errcheck // testing + fs.MkdirAll(home, 0755) //nolint:errcheck // testing mock. EXPECT(). GetHomeDir(). @@ -243,7 +243,7 @@ func TestPlugin_createNpmrc_StrictSSLSet(t *testing.T) { } p, mock, fs := createTestPlugin(t, c) home := path.Join("usr", "mctestface") - fs.MkdirAll(home, 0755) // nolint: errcheck // testing + fs.MkdirAll(home, 0755) //nolint:errcheck // testing mock. EXPECT(). GetHomeDir(). @@ -278,7 +278,7 @@ func TestPlugin_createNpmrc_AlwaysAuthSet(t *testing.T) { } p, mock, fs := createTestPlugin(t, c) home := path.Join("usr", "mctestface") - fs.MkdirAll(home, 0755) // nolint: errcheck // testing + fs.MkdirAll(home, 0755) //nolint:errcheck // testing mock. EXPECT(). GetHomeDir(). @@ -317,7 +317,7 @@ func TestPlugin_createNpmrc_All(t *testing.T) { } p, mock, fs := createTestPlugin(t, c) home := path.Join("usr", "mctestface") - fs.MkdirAll(home, 0755) // nolint: errcheck // testing + fs.MkdirAll(home, 0755) //nolint:errcheck // testing mock. EXPECT(). GetHomeDir().