Skip to content

Upgrade golangci-lint from v1 to v2#1279

Open
sebrandon1 wants to merge 1 commit intoopenshift:mainfrom
sebrandon1:golangci-lint-v2-upgrade
Open

Upgrade golangci-lint from v1 to v2#1279
sebrandon1 wants to merge 1 commit intoopenshift:mainfrom
sebrandon1:golangci-lint-v2-upgrade

Conversation

@sebrandon1
Copy link
Member

Summary

  • Update golangci-lint from v1.64.8 to v2.0.2
  • Migrate .golangci.yaml to v2 format

Changes Made

  • Makefile: Updated version variable
  • .golangci.yaml: Converted to v2 format
    • Added version: "2" declaration
    • Moved gofumpt to formatters.enable

Test plan

  • CI linting passes with golangci-lint v2
  • No new linting errors introduced

Tracking: redhat-best-practices-for-k8s/telco-bot#49

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jan 16, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: sebrandon1
Once this PR has been reviewed and has the lgtm label, please assign ricardomaraschini for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details 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

@flavianmissi
Copy link
Member

thanks for this @sebrandon1 !
The verify job is failing with the following:

Error: unknown linters: 'gosimple', run 'golangci-lint help linters' to see the list of supported linters
Failed executing command with error: unknown linters: 'gosimple', run 'golangci-lint help linters' to see the list of supported linters

I see that gosimple was working fine with golanci-lint v1... do you know what might have happened to make it so that it cannot be found on v2?

@sebrandon1 sebrandon1 force-pushed the golangci-lint-v2-upgrade branch from 45b0dd8 to ccf9175 Compare February 23, 2026 15:15
@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 23, 2026
@sebrandon1
Copy link
Member Author

Thanks for catching that @flavianmissi! In golangci-lint v2, gosimple was merged into staticcheck and is no longer a standalone linter. I've pushed a fix removing it from the config — since staticcheck is already enabled, all the gosimple checks are still covered. CI should be green now.

@sebrandon1 sebrandon1 force-pushed the golangci-lint-v2-upgrade branch from ccf9175 to 92dc720 Compare February 23, 2026 15:47
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 23, 2026
- Update GOLANGCI_LINT_VERSION from v1.64.8 to v2.0.2
- Migrate .golangci.yaml to v2 format:
  - Add version: "2" declaration
  - Move gofumpt to formatters.enable section
  - Remove gosimple linter (merged into staticcheck in v2)

Tracking: redhat-best-practices-for-k8s/telco-bot#49
@sebrandon1 sebrandon1 force-pushed the golangci-lint-v2-upgrade branch from 92dc720 to 61a59f8 Compare February 23, 2026 15:50
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Feb 23, 2026

@sebrandon1: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-azure-operator ccf9175 link false /test e2e-azure-operator
ci/prow/e2e-openstack ccf9175 link false /test e2e-openstack
ci/prow/e2e-gcp-ovn ccf9175 link false /test e2e-gcp-ovn
ci/prow/e2e-gcp-operator ccf9175 link false /test e2e-gcp-operator
ci/prow/verify 61a59f8 link true /test verify
ci/prow/e2e-vsphere ccf9175 link false /test e2e-vsphere
ci/prow/e2e-hypershift 61a59f8 link true /test e2e-hypershift
ci/prow/e2e-azure-ovn ccf9175 link false /test e2e-azure-ovn
ci/prow/e2e-vsphere-operator ccf9175 link true /test e2e-vsphere-operator

Full PR test history. Your PR dashboard.

Details

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants