Skip to content

Bump and adopt golangci-lint v2 #2404

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 1 commit into from
Jun 30, 2025

Conversation

kishen-v
Copy link
Contributor

What this PR does / why we need it:
This PR adopts the usage of golangci-lint tool(v2) from the existing v1, which is unmaintained. This will allow the latest available features and enhancements to be used associated with the v2 release.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):

Fixes #2360

Special notes for your reviewer:
I'd ensured that most of the existing functionalities and checks are in place. Please let me know if additional changes are needed.

With golangci-lint v1:
INFO [runner] Issues before processing: 462, after processing: 0
INFO [runner] Processors filtering stat (in/out): cgo: 462/462, skip_files: 462/363, skip_dirs: 363/363, nolint_filter: 138/0, exclusion_paths: 462/462, generated_file_filter: 363/363, exclusion_rules: 363/138, path_absoluter: 462/462, filename_unadjuster: 462/462, invalid_issue: 462/462, path_relativity: 462/462, identifier_marker: 363/363

With golangci-lint v2:
INFO [runner] Issues before processing: 477, after processing: 0
INFO [runner] Processors filtering stat (in/out): path_absoluter: 477/477, cgo: 477/477, invalid_issue: 477/477, exclusion_paths: 477/377, generated_file_filter: 377/363, exclusion_rules: 363/138, nolint_filter: 138/0, filename_unadjuster: 477/477, path_relativity: 477/477

/area provider/ibmcloud
/priority important-longterm
/kind cleanup

Release note:

Adopt v2 spec of golangci-lint

@k8s-ci-robot k8s-ci-robot added area/provider/ibmcloud Issues or PRs related to ibmcloud provider priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. labels Jun 27, 2025
Copy link

netlify bot commented Jun 27, 2025

Deploy Preview for kubernetes-sigs-cluster-api-ibmcloud ready!

Name Link
🔨 Latest commit e526711
🔍 Latest deploy log https://app.netlify.com/projects/kubernetes-sigs-cluster-api-ibmcloud/deploys/6862441e81fcc800080f424b
😎 Deploy Preview https://deploy-preview-2404.cluster-api-ibmcloud.sigs.k8s.io
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jun 27, 2025
@k8s-ci-robot k8s-ci-robot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Jun 27, 2025
text: "ST1003: should not use underscores in Go names;"
path: .*(api|types)\/.*\/.*conversion.*\.go$
- linters:
- staticcheck
Copy link
Contributor Author

Choose a reason for hiding this comment

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

  • ⚠️ Merge staticcheck, stylecheck, gosimple into one linter (staticcheck) (cf. Migration guide)

@@ -495,7 +495,7 @@ docker-build-core-image: ensure-buildx ## Build the multiarch core docker image

.PHONY: lint
lint: $(GOLANGCI_LINT) ## Lint codebase
$(GOLANGCI_LINT) run -v --fast=false
$(GOLANGCI_LINT) run -v --fast-only=false
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@@ -214,7 +214,7 @@ type Passwd struct {

// PasswdGroup holds the PasswdGroup specific information.
type PasswdGroup struct {
Gid *int `json:"gid,omitempty"` //nolint:stylecheck
Gid *int `json:"gid,omitempty"` //nolint:staticcheck
Copy link
Contributor Author

Choose a reason for hiding this comment

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

stylecheck is now clubbed under staticcheck

@kishen-v kishen-v requested a review from Prajyot-Parab June 30, 2025 07:58
@kishen-v kishen-v changed the title Bump and adopt golangci-lint v2 [WIP]Bump and adopt golangci-lint v2 Jun 30, 2025
@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 30, 2025
@kishen-v kishen-v changed the title [WIP]Bump and adopt golangci-lint v2 Bump and adopt golangci-lint v2 Jun 30, 2025
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 30, 2025
Copy link
Contributor

@Prajyot-Parab Prajyot-Parab left a comment

Choose a reason for hiding this comment

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

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 30, 2025
@Prajyot-Parab
Copy link
Contributor

/cc @Amulyam24

@k8s-ci-robot k8s-ci-robot requested a review from Amulyam24 June 30, 2025 12:27
Copy link
Contributor

@Amulyam24 Amulyam24 left a comment

Choose a reason for hiding this comment

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

/lgtm

Thanks @kishen-v !

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Amulyam24, kishen-v, Prajyot-Parab

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 Jun 30, 2025
@k8s-ci-robot k8s-ci-robot merged commit fc9677c into kubernetes-sigs:main Jun 30, 2025
14 checks passed
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. area/provider/ibmcloud Issues or PRs related to ibmcloud provider cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm "Looks good to me", indicates that a PR is ready to be merged. priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Migrate golangci-linter from v1 to v2
4 participants