Skip to content
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

Upgrade GolangCI-Lint to Latest Version (v2.0.2) #4677

Open
camilamacedo86 opened this issue Mar 26, 2025 · 5 comments
Open

Upgrade GolangCI-Lint to Latest Version (v2.0.2) #4677

camilamacedo86 opened this issue Mar 26, 2025 · 5 comments
Assignees
Labels
good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines.

Comments

@camilamacedo86
Copy link
Member

We need to upgrade GolangCI-Lint to the latest version: https://github.com/golangci/golangci-lint/releases/tag/v2.0.2

Tasks

  1. Update GolangciLintVersion in code scaffolding

Update the version in:

GolangciLintVersion = "v1.63.4"

Current:

const GolangciLintVersion = "v1.63.4"

Update to:

const GolangciLintVersion = "v2.0.2"

Then run:
make generate


  1. Update the Makefile install script

In the Makefile:
https://github.com/kubernetes-sigs/kubebuilder/blob/master/Makefile

Current:

GOLANGCI_LINT = $(shell pwd)/bin/golangci-lint
golangci-lint:
	@[ -f $(GOLANGCI_LINT) ] || { \
	set -e ;\
	curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(shell dirname $(GOLANGCI_LINT)) v1.63.4 ;\
	}

Update to:

GOLANGCI_LINT = $(shell pwd)/bin/golangci-lint
golangci-lint:
	@[ -f $(GOLANGCI_LINT) ] || { \
	set -e ;\
	curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(shell dirname $(GOLANGCI_LINT)) v2.0.2 ;\
	}

  1. Update GitHub Actions Linter Workflow

In the workflow file:
https://github.com/kubernetes-sigs/kubebuilder/blob/master/.github/workflows/lint.yml

Current:

  - name: Run linter
    uses: golangci/golangci-lint-action@v6
    with:
      version: v1.63.4

Update to:

  - name: Run linter
    uses: golangci/golangci-lint-action@v6
    with:
      version: v2.0.2
  1. Fix any lint issue that might be faced after the update to allow pass in the CI
@camilamacedo86 camilamacedo86 added the good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. label Mar 26, 2025
@camilamacedo86
Copy link
Member Author

Note that we might either need to update the action: #4637

@sarthaksarthak9
Copy link
Contributor

/assign

@harshsennnn
Copy link

@sarthaksarthak9 are u still working on this?

@chethanm99
Copy link
Contributor

chethanm99 commented Apr 9, 2025

Hi @sarthaksarthak9 are you still working on this issue??

@Kuzuri247
Copy link
Contributor

@camilamacedo86 please close this issue linter is updated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines.
Projects
None yet
Development

No branches or pull requests

5 participants