-
Notifications
You must be signed in to change notification settings - Fork 460
Bump golangci-lint to v2.1.2 #5566
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
Bump golangci-lint to v2.1.2 #5566
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #5566 +/- ##
=======================================
Coverage 52.86% 52.87%
=======================================
Files 272 272
Lines 29474 29473 -1
=======================================
+ Hits 15582 15583 +1
- Misses 13080 13083 +3
+ Partials 812 807 -5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
b0ab31d to
8996658
Compare
| .PHONY: lint-latest ## TODO: update the lint-latest to lint-azure-latest | ||
| lint-latest: | ||
| ./hack/lint-latest.sh ## TODO: update the lint-latest.sh to lint-azure-latest.sh | ||
| .PHONY: lint-azure-latest ## Check for usage of the "latest" floating Azure API version. |
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.
Thank you!
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 had been ignoring this TODO that gets printed every time you lint, but once I looked at it I understood what @devigned meant.
|
|
||
| for _, char := range *name { | ||
| if !(unicode.IsLower(char) || unicode.IsNumber(char)) { | ||
| if !unicode.IsLower(char) && !unicode.IsNumber(char) { |
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.
De Morgan's law.
|
|
||
| desiredMatchesActual := len(m.vmssState.Instances) == int(m.DesiredReplicas()) | ||
| return !(state != nil && infrav1.IsTerminalProvisioningState(*state) && desiredMatchesActual) | ||
| return state == nil || !infrav1.IsTerminalProvisioningState(*state) || !desiredMatchesActual |
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.
De Morgan's law. Both are equivalent :)
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.
Yep, some new linter flagged these with "De Morgan's Law."
|
/lgtm |
|
LGTM label has been added. Git tree hash: 8a7d0b61b4c8d646886b74cfcf8ca615b4fd14b2
|
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: nawazkh 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 |
What type of PR is this?
/kind cleanup
What this PR does / why we need it:
Updates golangci-lint to v2.1.2.
This involved migrating the config file to v2 format, removing two linters that are now unsupported (gosimple and stylecheck), and updating a few bits of code.
Some
golangci-lintcommand-line arguments have changed. In particular, there is no longer a--fast=[true|false]flag, only a--fast-onlyflag that runs a quick subset of all linters. So I added amake lint-fasttarget for clarity, and nowmake lintandmake lint-fullare the same target. I think this is fine because the new tool seems much faster than the v1.x versions, but let me know what you think.Which issue(s) this PR fixes:
Refs #5549
Special notes for your reviewer:
v2 migration guide: https://golangci-lint.run/product/migration-guide/
TODOs:
Release note: