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 v1.51.2 #5085

Merged

Conversation

koba1t
Copy link
Member

@koba1t koba1t commented Mar 8, 2023

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Mar 8, 2023
@k8s-ci-robot
Copy link
Contributor

This PR has multiple commits, and the default merge method is: merge.
You can request commits to be squashed using the label: tide/merge-method-squash

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 size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Mar 8, 2023
.golangci.yml Outdated
Comment on lines 9 to 10
# please, do not use `enable-all`: it's deprecated and will be removed soon.
# inverted configuration with `enable-all` and `disable` is not scalable during updates of golangci-lint
Copy link
Member Author

Choose a reason for hiding this comment

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

enable-all option is Un-deprecated.
golangci/golangci-lint#1888

.golangci.yml Outdated
Comment on lines 30 to 36
- exhaustruct
- deadcode
- scopelint
- nonamedreturns
- golint
- maintidx
- nosnakecase
Copy link
Member Author

@koba1t koba1t Mar 8, 2023

Choose a reason for hiding this comment

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

These linters were not "comment out" on config, but didn't enabled.

.golangci.yml Outdated
@@ -6,93 +6,34 @@ run:
go: '1.19'

linters:
# please, do not use `enable-all`: it's deprecated and will be removed soon.
# inverted configuration with `enable-all` and `disable` is not scalable during updates of golangci-lint
Copy link
Contributor

Choose a reason for hiding this comment

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

I agree that we can remove the comment about enable-all being deprecated, but I think the second comment inverted configuration with enable-allanddisable is not scalable during updates of golangci-lint is still valid. I think it will be better to use disable-all and enable, but you can go ahead and enable to the specific linters you want. It will make it easier to review upgrades this way too

Copy link
Member Author

@koba1t koba1t Mar 10, 2023

Choose a reason for hiding this comment

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

Thanks for your comment.

I think the second comment inverted configuration with enable-all and disable is not scalable during updates of golangci-lint is still valid.

Sorry I don't understand why enable-all is not scalable during updates because we are still pinning golangci-lint version on Makefile and I think we add new linter with checking golangci-lint release notes every update PR make.

So, I think the disable-all and enable operation is unscalable than the enable-all and we didn't investigate what we should enable.

Copy link
Member Author

Choose a reason for hiding this comment

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

So, I will revert it for now.

Copy link
Contributor

Choose a reason for hiding this comment

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

I see. Ok, I'll approve this PR right now so that we can get the lint check passing again. And feel free to open a new PR with enable-all and disable so we can discuss that separately.

@k8s-ci-robot k8s-ci-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Mar 10, 2023
@koba1t koba1t force-pushed the chore/update_golangci_to_1.51.2 branch from 5860615 to 39264a7 Compare March 10, 2023 20:03
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Mar 10, 2023
@k8s-ci-robot k8s-ci-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Mar 10, 2023
@natasha41575
Copy link
Contributor

/lgtm
/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: koba1t, natasha41575

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 lgtm "Looks good to me", indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Mar 10, 2023
@k8s-ci-robot k8s-ci-robot merged commit bf6e6ad into kubernetes-sigs:master Mar 10, 2023
@koba1t koba1t deleted the chore/update_golangci_to_1.51.2 branch March 11, 2023 01:26
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. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants