-
Notifications
You must be signed in to change notification settings - Fork 4.1k
chore: bump golangci lint to v2 #8203
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
base: master
Are you sure you want to change the base?
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: jklaw90 The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
version: "2" | ||
linters: | ||
default: none |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you explain why we need this?
I see that v8.0.0 works with golangci-lint version >= v2.1.0, ref: https://github.com/golangci/golangci-lint-action?tab=readme-ov-file#compatibility . should this version needs to be changed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i assumed it was off by default in v1. but it seems staticcheck
just is flagging a lot more stuff in v2. updated to address issues. I can also leave the text as is and add no lints if you'd like.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can proceed with these changes or ignore the all these inline?
also i figured after seeing all the duplicate imports we should order it with gci
to make things more visible
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMHO I think it's good to have those lints.
@adrianmoisey WDYT?
e91fd44
to
9995f2d
Compare
if resizePendingCondition.Reason == apiv1.PodReasonDeferred { | ||
switch resizePendingCondition.Reason { | ||
case apiv1.PodReasonDeferred: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are those changes required because of the new linter?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, staticcheck flagged almost all of them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's cool.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Personally, I like it. I'd love for the other approvers to take a look as well.
We can't merge it yet until the failed unit test is fixed, so I'm adding a hold to prevent accidental merging.
/lgtm
/hold
9995f2d
to
57a4cec
Compare
57a4cec
to
c84a7b7
Compare
seems to be failing cluster autoscaler tests from main. I'll wait till they fix it and rebase |
There's a lot here, it all seems OK to me. |
@jklaw90 you can rebase off of current master, CA UT is fixed |
updated to enable by default imports clean up fixing test cases
c84a7b7
to
504a985
Compare
@jackfrancis done, thank you |
/lgtm |
What type of PR is this?
/kind cleanup
What this PR does / why we need it:
version 2 of golangci-lint. its been out for a little while now.
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: