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

Update golangci-lint to 1.52.2 #56

Merged
merged 1 commit into from
Apr 18, 2023

Conversation

marckhouzam
Copy link
Contributor

@marckhouzam marckhouzam commented Apr 18, 2023

⚠️ you must remove the old version of the linter to properly get this change locally: rm -rf hack/tools/bin/golangci-lint

What this PR does / why we need it

I wanted to use generics in #55 but the golangci-lint version we are using is too old and gocritic panics.
This commit updates the version to 1.52.2.

Note that "allow-leading-space" is no longer supported as mentioned in golangci/golangci-lint#3063 (comment) and therefore has been removed. All instances of // nolint have been update to remove the space.

A couple of new warnings were also fixed.

Finally, I have rebase #55 and confirmed we can use generics without linter warnings when using this PR.

Which issue(s) this PR fixes

Fixes # N/A

Describe testing done for PR

make go-lint

I also tried #55 which is introducing generics and ran make go-lint. Before this PR, the linter panics but with this PR it all passes.

Release note


Additional information

Special notes for your reviewer

@marckhouzam marckhouzam requested a review from a team as a code owner April 18, 2023 12:18
Some of the updated linters require go 1.19 so this commit updates the
github workflow to use go 1.19 for the "check" section.

Note that "allow-leading-space" is no longer supported as mentioned in
golangci/golangci-lint#3063 (comment)

Fix new warnings that are now reported.

Signed-off-by: Marc Khouzam <kmarc@vmware.com>
Copy link
Contributor

@mpanchajanya mpanchajanya 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 doing this

@marckhouzam marckhouzam merged commit b2c7a27 into vmware-tanzu:main Apr 18, 2023
@marckhouzam marckhouzam deleted the feat/updateGolangci branch April 18, 2023 16:52
vuil pushed a commit that referenced this pull request May 2, 2023
Some of the updated linters require go 1.19 so this commit updates the
github workflow to use go 1.19 for the "check" section.

Note that "allow-leading-space" is no longer supported as mentioned in
golangci/golangci-lint#3063 (comment)

Fix new warnings that are now reported.

Signed-off-by: Marc Khouzam <kmarc@vmware.com>
@marckhouzam marckhouzam added this to the v0.90.0 milestone Oct 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants