Skip to content

Conversation

@sebrandon1
Copy link
Member

Summary

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

Changes Made

  • Makefile: Updated version variable
  • .golangci.yml: Converted to v2 format with proper structure

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 marioferh 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

@simonpasquier
Copy link
Contributor

The new linter requires some code changes.

- Update GOLANGCI_LINT_VERSION from v1.64.8 to v2.0.2
- Migrate .golangci.yml to v2 format:
  - Add version: "2" declaration
  - Move linters-settings under linters.settings

Tracking: redhat-best-practices-for-k8s/telco-bot#49
@sebrandon1 sebrandon1 force-pushed the golangci-lint-v2-upgrade branch from a1cba07 to e789919 Compare January 19, 2026 15:13
@sebrandon1
Copy link
Member Author

I've fixed the linter failures by updating the .golangci.yml configuration for v2 compatibility:

  • Added proper exclude-functions for errcheck to handle Close(), Log(), and fmt.Fprintln calls
  • Configured govet.disable for testinggoroutine (v2 format)
  • Added staticcheck.checks to disable checks that weren't enforced in v1 (SA2002, SA1019, SA4006, SA4001, ST1000, ST1005, ST1020, QF1002)
  • Removed unused testCloser type from pkg/runutil/runutil_test.go

The ci/prow/lint job is now passing ✅

@simonpasquier
Copy link
Contributor

I'd prefer to fix the linter issues first then update the linter version.

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jan 19, 2026

@sebrandon1: all tests passed!

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.

@sebrandon1
Copy link
Member Author

sebrandon1 commented Jan 19, 2026

So I've been messing with v1 and I don't believe it was failing in v1. v2 has some newer/stricter/updated checks so its possible that v1 was passing just fine but v2 is now flagging the code as having linter errors which I fixed here.

- unused
linters-settings:
errcheck:
exclude: .errcheck_excludes.txt
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we remove that file?

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.

2 participants