Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upgrade lint version and perform fixes #1572

Merged
merged 1 commit into from
Jun 25, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion pkg/cli/plugins_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
3 changes: 2 additions & 1 deletion pkg/plugin/v2/scaffolds/edit.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ func (s *editScaffolder) Scaffold() error {
return err
}
}

// false positive
// nolint:gosec
return ioutil.WriteFile(filename, []byte(str), 0644)
}

Expand Down
3 changes: 2 additions & 1 deletion pkg/plugin/v3/scaffolds/edit.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ func (s *editScaffolder) Scaffold() error {
return err
}
}

// false positive
// nolint:gosec
return ioutil.WriteFile(filename, []byte(str), 0644)
}

Expand Down
5 changes: 4 additions & 1 deletion test/e2e/utils/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down Expand Up @@ -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)
}
3 changes: 2 additions & 1 deletion test/e2e/v2/e2e_suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down
3 changes: 2 additions & 1 deletion test/e2e/v3/e2e_suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down