From d6177527df9fa7cc7274ded0f03caedf6c343003 Mon Sep 17 00:00:00 2001 From: Camila Macedo Date: Sun, 21 Jun 2020 22:44:05 +0100 Subject: [PATCH] upgrade lint version and perform fixes --- .travis.yml | 2 +- pkg/cli/plugins_test.go | 2 +- pkg/plugin/v2/scaffolds/edit.go | 3 ++- pkg/plugin/v3/scaffolds/edit.go | 3 ++- test/e2e/utils/util.go | 5 ++++- test/e2e/v2/e2e_suite.go | 3 ++- test/e2e/v3/e2e_suite.go | 3 ++- 7 files changed, 14 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index be6e9e2cd87..7c8b3d27e5d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,7 +24,7 @@ script: ./test.sh jobs: include: - stage: linting - before_script: curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.23.3 + before_script: curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.27.0 script: make lint after_success: echo "Linting check succeeded" after_failure: echo "Linting check failed. Run make lint to check it locally" diff --git a/pkg/cli/plugins_test.go b/pkg/cli/plugins_test.go index 21d7e9e81dd..c0d7d8c2a41 100644 --- a/pkg/cli/plugins_test.go +++ b/pkg/cli/plugins_test.go @@ -96,7 +96,7 @@ var _ = Describe("resolvePluginsByKey", func() { _, err = resolvePluginsByKey(plugins, "foo.example.com/v2") Expect(err).To(MatchError(errAmbiguousPlugin{ key: "foo.example.com/v2", - msg: fmt.Sprintf(`no versions match, possible plugins: ["foo.example.com/v1"]`), + msg: `no versions match, possible plugins: ["foo.example.com/v1"]`, })) By("resolving foo/v3") diff --git a/pkg/plugin/v2/scaffolds/edit.go b/pkg/plugin/v2/scaffolds/edit.go index 08221c98c30..5e9389024d4 100644 --- a/pkg/plugin/v2/scaffolds/edit.go +++ b/pkg/plugin/v2/scaffolds/edit.go @@ -68,7 +68,8 @@ func (s *editScaffolder) Scaffold() error { return err } } - + // false positive + // nolint:gosec return ioutil.WriteFile(filename, []byte(str), 0644) } diff --git a/pkg/plugin/v3/scaffolds/edit.go b/pkg/plugin/v3/scaffolds/edit.go index 08221c98c30..5e9389024d4 100644 --- a/pkg/plugin/v3/scaffolds/edit.go +++ b/pkg/plugin/v3/scaffolds/edit.go @@ -68,7 +68,8 @@ func (s *editScaffolder) Scaffold() error { return err } } - + // false positive + // nolint:gosec return ioutil.WriteFile(filename, []byte(str), 0644) } diff --git a/test/e2e/utils/util.go b/test/e2e/utils/util.go index 1185391c8a6..155d56cb5e2 100644 --- a/test/e2e/utils/util.go +++ b/test/e2e/utils/util.go @@ -65,6 +65,8 @@ func InsertCode(filename, target, code string) error { } idx := strings.Index(string(contents), target) out := string(contents[:idx+len(target)]) + code + string(contents[idx+len(target):]) + // false positive + // nolint:gosec return ioutil.WriteFile(filename, []byte(out), 0644) } @@ -100,6 +102,7 @@ func UncommentCode(filename, target, prefix string) error { if err != nil { return err } - + // false positive + // nolint:gosec return ioutil.WriteFile(filename, out.Bytes(), 0644) } diff --git a/test/e2e/v2/e2e_suite.go b/test/e2e/v2/e2e_suite.go index 8c9ca113802..3d3d455e0d5 100644 --- a/test/e2e/v2/e2e_suite.go +++ b/test/e2e/v2/e2e_suite.go @@ -377,7 +377,8 @@ func implementWebhooks(filename string) error { if err != nil { return err } - + // false positive + // nolint:gosec return ioutil.WriteFile(filename, []byte(str), 0644) } diff --git a/test/e2e/v3/e2e_suite.go b/test/e2e/v3/e2e_suite.go index faf353e18c6..d732477a336 100644 --- a/test/e2e/v3/e2e_suite.go +++ b/test/e2e/v3/e2e_suite.go @@ -377,7 +377,8 @@ func implementWebhooks(filename string) error { if err != nil { return err } - + // false positive + // nolint:gosec return ioutil.WriteFile(filename, []byte(str), 0644) }