Skip to content

Adopt shared golangci-lint config from sdk-go [main] - #86

Merged
xuezhaojun merged 1 commit into
open-cluster-management-io:mainfrom
xuezhaojun:adopt-shared-lint-config
Mar 4, 2026
Merged

Adopt shared golangci-lint config from sdk-go [main]#86
xuezhaojun merged 1 commit into
open-cluster-management-io:mainfrom
xuezhaojun:adopt-shared-lint-config

Conversation

@xuezhaojun

Copy link
Copy Markdown
Member

Summary

  • Add a make lint target that uses the shared lint scripts from sdk-go, enabling zero-configuration linting that auto-detects Go version and downloads the appropriate golangci-lint v2
  • Fix all 13 lint issues found by the shared configuration:
    • goimports (3): Fixed import grouping to follow open-cluster-management.io local-prefix convention across clusterpermission_controller.go, clusterpermission_status_controller.go, main.go, and helper.go
    • revive (2): Removed ALL_CAPS constant naming (VALIDATION_MW_RETRY_INTERVAL was unused, so removed entirely); fixed indent-error-flow in getSubjects()
    • staticcheck QF1008 (3): Simplified r.Client.Create/Update/List to r.Create/Update/List by removing redundant embedded field selector
    • staticcheck QF1003 (2): Converted if/else-if chains to tagged switch statements in helper.go
    • staticcheck SA1019 (2): Replaced deprecated workqueue.RateLimitingInterface and workqueue.DefaultControllerRateLimiter() with typed equivalents
    • unused (1): Removed unused addKnownTypes() function from groupversion_info.go

Test plan

  • make lint passes with 0 issues
  • go build ./... compiles successfully
  • CI pipeline passes

🤖 Generated with Claude Code

Add a `make lint` target that uses the shared lint scripts from sdk-go,
and resolve all lint errors including import formatting, naming conventions,
deprecated API usage, and unused code.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: xuezhaojun <zxue@redhat.com>
@openshift-ci
openshift-ci Bot requested a review from elgnay March 4, 2026 04:33
@openshift-ci

openshift-ci Bot commented Mar 4, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: xuezhaojun
Once this PR has been reviewed and has the lgtm label, please assign elgnay 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

@xuezhaojun xuezhaojun closed this Mar 4, 2026
@xuezhaojun xuezhaojun reopened this Mar 4, 2026
@codecov

codecov Bot commented Mar 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 68.94%. Comparing base (740564a) to head (9280237).
⚠️ Report is 5 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #86      +/-   ##
==========================================
- Coverage   69.13%   68.94%   -0.19%     
==========================================
  Files           4        4              
  Lines         891      892       +1     
==========================================
- Hits          616      615       -1     
- Misses        242      243       +1     
- Partials       33       34       +1     
Flag Coverage Δ
unit 68.94% <ø> (-0.19%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@xuezhaojun
xuezhaojun merged commit 0028cac into open-cluster-management-io:main Mar 4, 2026
10 of 14 checks passed
@xuezhaojun
xuezhaojun deleted the adopt-shared-lint-config branch March 4, 2026 08:58
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