-
Notifications
You must be signed in to change notification settings - Fork 1.5k
no-jira: Fix linting issues for golangci-lint v2 #10138
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: main
Are you sure you want to change the base?
Conversation
|
@barbacbd: This pull request explicitly references no jira issue. In response to this:
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 openshift-eng/jira-lifecycle-plugin repository. |
|
Adding some context here: The following PR was opened to update the golangci-lint used in the installer. Then the PR was opened to update the CI side. This PR will fix the "Quick Fix" issues raised by the update to the installer. We will skip certain errors but these are found and needed to be fixed. |
pkg/agent/logging.go: QF1006: could lift into loop condition Skip lint check. pkg/asset/manifests/azure/cluster.go: QF1003: could use tagged switch on subnetType Use a switch instead of if-else pkg/infrastructure/azure/storage.go: QF1007: could merge conditional assignment into variable declaration pkg/infrastructure/baremetal/image.go: QF1009: probably want to use time.Time.Equal instead Use function for time.Equal rather than ==.
1a378fa to
85acb4d
Compare
tthvo
left a comment
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 think we need to update ./hack/go-lint.sh to point to the new v2 config:
Line 9 in 75bbd5d
| golangci-lint run -v --new-from-rev=dcf8122 "${@}" |
There seems to be a few more to fix 👇
pkg/asset/agent/common/infraenv.go:1:9: var-naming: avoid meaningless package names (revive)
package common
^
pkg/types/common/common.go:1:9: var-naming: avoid meaningless package names (revive)
package common
^
pkg/utils/vmware.go:1:9: var-naming: avoid meaningless package names (revive)
package utils
^
3 issues:
* revive: 3
tthvo
left a comment
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.
/approve
Local test showed v2 go-lint is happy.
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: tthvo 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 |
|
/retest |
|
I ran lint locally with this PR + the new v2 config: There is no more lint issues reported as of now (i.e. other PR merge might introduce more). The changes also match with the complaints from rehearsal: rehearse-72011-pull-ci-openshift-installer-main-golint/1995877671170478080. /verified by local-lint-runs |
|
@tthvo: This PR has been marked as verified by In response to this:
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 openshift-eng/jira-lifecycle-plugin repository. |
|
/retest-required |
|
@barbacbd: The following tests failed, say
Full PR test history. Your PR dashboard. 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-sigs/prow repository. I understand the commands that are listed here. |
|
/hold This is a nice to have and will be looked at again after release. |
pkg/agent/logging.go:
QF1006: could lift into loop condition
Skip lint check.
pkg/asset/manifests/azure/cluster.go:
QF1003: could use tagged switch on subnetType
Use a switch instead of if-else
pkg/infrastructure/azure/storage.go:
QF1007: could merge conditional assignment into variable declaration
pkg/infrastructure/baremetal/image.go:
QF1009: probably want to use time.Time.Equal instead Use function for time.Equal rather than ==.