Skip to content

ci: update golangci-lint to v2 #488

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

Merged
merged 4 commits into from
Mar 25, 2025

Conversation

akhilerm
Copy link
Member

@akhilerm akhilerm commented Mar 25, 2025

  • migrate golangci-lint to v2
  • comment out default enabled linters from gocritic
  • fix staticcheck errors and simplify if conditions
  • update golangci-lint-action to v7

@k8s-ci-robot k8s-ci-robot requested review from cici37 and jimangel March 25, 2025 15:14
@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Mar 25, 2025
@akhilerm
Copy link
Member Author

/cc @saschagrunert

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Mar 25, 2025
.golangci.yml file has been migrated by running
`golangci-lint migrate`

Signed-off-by: Akhil Mohan <akhilerm@gmail.com>
these linters were giving a warning similar to
```
WARN [linters_context] gocritic: no need to enable check "appendAssign": it's already enabled
WARN [linters_context] gocritic: no need to enable check "argOrder": it's already enabled
```

Signed-off-by: Akhil Mohan <akhilerm@gmail.com>
- fix QF1001 and QF1006
- simplify if condition after fixing static check

Signed-off-by: Akhil Mohan <akhilerm@gmail.com>
Signed-off-by: Akhil Mohan <akhilerm@gmail.com>
@akhilerm akhilerm force-pushed the update-golangci-v2 branch from 178f2a9 to 7fe767c Compare March 25, 2025 16:36
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 25, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: akhilerm, saschagrunert

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 the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 25, 2025
@k8s-ci-robot k8s-ci-robot merged commit 557518c into kubernetes:master Mar 25, 2025
7 checks passed
@akhilerm akhilerm deleted the update-golangci-v2 branch April 11, 2025 09:53
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/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants