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

🌱 lint: enable gocritic configuration and fix findings #2315

Merged

Conversation

MrDXY
Copy link
Contributor

@MrDXY MrDXY commented Sep 4, 2023

What this PR does / why we need it:

  1. Enable gocritic configuration in the .golangci.yml file's linters-settings section to check for potential bugs, performance improvements, and style issues.
  2. Fix findings related to it.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Part of #2058

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Sep 4, 2023
@k8s-ci-robot
Copy link
Contributor

Hi @MrDXY. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Sep 4, 2023
@sbueringer
Copy link
Member

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Sep 4, 2023
@MrDXY
Copy link
Contributor Author

MrDXY commented Sep 4, 2023

/retest

@MrDXY
Copy link
Contributor Author

MrDXY commented Sep 4, 2023

I'll take a closer look at the tests that have failed.

@MrDXY
Copy link
Contributor Author

MrDXY commented Sep 5, 2023

/hold

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 5, 2023
@MrDXY
Copy link
Contributor Author

MrDXY commented Sep 5, 2023

/test pull-cluster-api-provider-vsphere-test-main

@MrDXY MrDXY force-pushed the pr-golangci-enable-gocritic branch from 8b21b4c to 21f31e0 Compare September 5, 2023 04:28
@MrDXY
Copy link
Contributor Author

MrDXY commented Sep 5, 2023

/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 5, 2023
@MrDXY
Copy link
Contributor Author

MrDXY commented Sep 5, 2023

/retest

pkg/services/govmomi/util.go Outdated Show resolved Hide resolved
test/helpers/vmware/intg_test_context.go Outdated Show resolved Hide resolved
test/helpers/vmware/intg_test_context.go Outdated Show resolved Hide resolved
Copy link
Contributor

@zhanggbj zhanggbj left a comment

Choose a reason for hiding this comment

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

only one nit
/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 5, 2023
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: e1c95dc1063309c66469f2515475c55e1ad607ba

@zhanggbj
Copy link
Contributor

zhanggbj commented Sep 5, 2023

/hold
(Just noticed other comments)

@k8s-ci-robot k8s-ci-robot added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Sep 5, 2023
@MrDXY MrDXY force-pushed the pr-golangci-enable-gocritic branch from 21f31e0 to b4b1bcb Compare September 6, 2023 02:26
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 6, 2023
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 6, 2023
@MrDXY MrDXY force-pushed the pr-golangci-enable-gocritic branch from b73662c to b4b1bcb Compare September 6, 2023 04:45
@sbueringer
Copy link
Member

sbueringer commented Sep 6, 2023

Last nit, otherwise good to merge from my side (#2315 (comment))

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 6, 2023
@MrDXY MrDXY force-pushed the pr-golangci-enable-gocritic branch from b4b1bcb to eb7f3e5 Compare September 6, 2023 09:44
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 6, 2023
@chrischdi
Copy link
Member

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 6, 2023
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 39d02efdcf8a85949b183f454679f0f79127fece

@sbueringer
Copy link
Member

Thank you!!

/approve

/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 6, 2023
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: sbueringer

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 6, 2023
@k8s-ci-robot k8s-ci-robot merged commit 69a97b9 into kubernetes-sigs:main Sep 6, 2023
7 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v1.9 milestone Sep 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants