Conversation
|
Hey @wainersm, |
@littlejawa commit 4669cc1 upgraded to golang 1.25 and I will be able to use a newer version of golangci-lint and hopefuly the GOPROXY hack won't be needed. I send a update soon. |
Update golangci-lint from v2.0.2 to v2.11.3.1. Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
Fix error messages to start with lowercase letters per Go style guide. This resolves 3 staticcheck ST1005 violations. Assisted-by: Claude Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
Remove duplicate import of k8s.io/apimachinery/pkg/api/errors package. Use the k8serrors alias consistently throughout the file. Resolves staticcheck ST1019 violation. Assisted-by: Claude Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
Simplify field access by removing redundant embedded field names: - ns.ObjectMeta.Labels -> ns.Labels - r.Client.Get/List/Delete -> r.Get/List/Delete - req.NamespacedName.Name -> req.Name Resolves several staticcheck QF1008 violations. Assisted-by: Claude Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
Convert multiple if-else if chains to tagged switch statements for better readability and maintainability: - confidential_handler.go: handler type selection - image_generator.go: provider type selection Resolves 2 staticcheck QF1003 violations. Assisted-by: Claude Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
Apply De Morgan's law to simplify complex boolean expression: !(A || B) -> !A && !B Makes the condition more readable and easier to understand. Resolves staticcheck QF1001 violation. Assisted-by: Claude Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
Remove two functions that are never called: - createMcFromFile in openshift_controller.go - parseMachineConfigYAML in utils.go Resolves 2 unused function violations. Assisted-by: Claude Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
Wrap all os.Setenv and os.Unsetenv calls with Expect().To(Succeed()) to properly handle error return values and resolve golangci-lint errcheck violations. Assisted-by: Claude Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
f610a54 to
48aa973
Compare
|
@littlejawa I bumped to golangci-lint 2.11.3 but it is pre-built with go 1.26 (unlike claude said): That's the latest version. I don't think the version it has used is a problem. I will work on a Github action to run it. So: /hold |
|
@littlejawa I just added a github workflow to run golangci-lint. I've using an action instead of calling |
db0949f to
e7bc8ea
Compare
The static-checks workflow is meant to trigger jobs on pull requests (or manually) to run static checkers (e.g. golangci-lint, commit check, etc) against the project. Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
e7bc8ea to
c4e81d8
Compare
The lint target runs golangci-lint that requires some controller code to be generate, otherwise it make misleading reports. Hence, make lint to depend on generate target. Also fixed the target help message as yamllint is not executed. Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
I found the problem. It needs to run |
|
@wainersm: The following test failed, say
Full PR test history. Your PR dashboard. DetailsInstructions 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. |
|
PR needs rebase. DetailsInstructions 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. |
- Description of the problem which is fixed/What is the use case
Currently we don't run any static analysis tool!
I've a plan to introduce some of those tools in our CI, and I wanted to start with golangci-lint.
- What I did
Ran
make lintand with help of claude I delinted the entire project.ps: our
.golangci-lintfile is configure to the mininum of mininum, that's why likely just a handful of errors were catch.- How to verify it
make lintand it should return 0 errors.