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

Enable previously disabled linters like nakedret, revive unparam, gosec from golang-cli.yml #647

Merged
merged 3 commits into from
Jan 18, 2024

Conversation

mpanchajanya
Copy link
Contributor

@mpanchajanya mpanchajanya commented Jan 16, 2024

What this PR does / why we need it

  • Enable previously disabled linters like nakedret, revive unparam, gosec from golang-cli.yml.

Which issue(s) this PR fixes

Fixes #

Describe testing done for PR

  • Run command make lint - no issues

Release note

Enable nakedret, revive unparam, gosec linters.

Additional information

Special notes for your reviewer

@mpanchajanya mpanchajanya marked this pull request as ready for review January 16, 2024 14:40
@mpanchajanya mpanchajanya requested a review from a team as a code owner January 16, 2024 14:40
@mpanchajanya mpanchajanya changed the title Enable nakedret, revive unparam linters Enable previously disabled linters like nakedret, revive unparam, gosec from golang-cli.yml Jan 16, 2024
Copy link
Contributor

@prkalle prkalle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I have one clarification question regarding the unparam false positives

@@ -66,6 +66,7 @@ func convertVersionToStringArray(arrOsArchInfo []osArch) []string {
return oa
}

//nolint:unparam
Copy link
Contributor

@prkalle prkalle Jan 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it a false positive? I see all the params are being used.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have disabled because of the error cmd/plugin/builder/command/publish/helper_test.go:69:48: createDummyArtifactDir-pluginNamealways receives"fake-plugin-foo"(unparam)

Copy link
Contributor

@anujc25 anujc25 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks for adding this and addressing some of the errors.

@marckhouzam
Copy link
Contributor

I'm removing myself as a reviewer due to time constraints.

@marckhouzam marckhouzam removed their request for review January 18, 2024 13:43
@marckhouzam marckhouzam added this to the v1.2.0 milestone Jan 18, 2024
@marckhouzam marckhouzam added the kind/cleanup Categorizes issue or PR as related to cleaning up code, process label Jan 18, 2024
@mpanchajanya mpanchajanya merged commit c82c122 into vmware-tanzu:main Jan 18, 2024
7 checks passed
vuil pushed a commit to vuil/tanzu-cli that referenced this pull request Jan 23, 2024
…ec from golang-cli.yml (vmware-tanzu#647)

* Fix nakedret, revive lint issues

* Enable unparam linter

* Enable gosec g601 and g602 linters
vuil pushed a commit that referenced this pull request Jan 23, 2024
…ec from golang-cli.yml (#647)

* Fix nakedret, revive lint issues

* Enable unparam linter

* Enable gosec g601 and g602 linters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-not-required kind/cleanup Categorizes issue or PR as related to cleaning up code, process
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants