Skip to content

Unify golangci-lint: replace Docker-based lint with go run pattern#1046

Open
aravindtga wants to merge 1 commit into
kptdev:mainfrom
Nordix:golangci-lint-go-run
Open

Unify golangci-lint: replace Docker-based lint with go run pattern#1046
aravindtga wants to merge 1 commit into
kptdev:mainfrom
Nordix:golangci-lint-go-run

Conversation

@aravindtga

Copy link
Copy Markdown
Contributor

Description

  • What changed: Replace Docker/container-based golangci-lint invocation with go run, rename GOLANG_CI_VER to GOLANGCI_LINT_VERSION, bump to v2.12.2. Add exclusion for govet inline analyzer's known generics limitation. Fix gofmt formatting issues in test files.
  • Why it's needed: The Docker-based approach requires a container runtime and pulls a large image. Using go run is simpler, reproducible, and consistent with the pattern used in the other repos (kpt, krm-functions-sdk, krm-functions-catalog).
  • How it works: go run github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v$(GOLANGCI_LINT_VERSION) downloads and runs the exact pinned version without needing Docker or a pre-installed binary.

Type of Change

  • Enhancement
  • Refactor

Checklist

  • Code follows project style guidelines
  • Self-reviewed changes
  • All tests and gating checks pass

AI Disclosure

  • I have used AI in the creation of this PR.

If so, please describe how:
- Kiro to assist with the Makefile refactoring and .golangci.json configuration.

@netlify

netlify Bot commented Jun 15, 2026

Copy link
Copy Markdown

Deploy Preview for kpt-porch ready!

Name Link
🔨 Latest commit 82bfda6
🔍 Latest deploy log https://app.netlify.com/projects/kpt-porch/deploys/6a33c00594ef6b0008708362
😎 Deploy Preview https://deploy-preview-1046--kpt-porch.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

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

@aravindtga aravindtga requested a review from Copilot June 15, 2026 13:52
@aravindtga aravindtga force-pushed the golangci-lint-go-run branch from f8243fb to 8affcc2 Compare June 15, 2026 13:52

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

This PR primarily updates Go linting to run golangci-lint via go run with a pinned version, and applies various gofmt/alignment cleanups in Go test files.

Changes:

  • Switch make lint to run golangci-lint via go run and introduce a new golangci-lint version variable.
  • Add a golangci-lint exclusion rule for a govet “inline: cannot inline” message.
  • Apply formatting fixes in several Go tests (imports/spacing/newlines).

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
pkg/task/generictaskhandler_test.go Formatting/alignment tweaks in test resource maps
make/go.mk Replace container/host branching lint logic with go run ...@version
controllers/packagerevisions/pkg/controllers/packagerevision/render_test.go Import order and whitespace formatting cleanups
controllers/packagerevisions/pkg/controllers/packagerevision/labels_test.go Fix malformed test function formatting
.golangci.json Add exclusion for govet “inline: cannot inline” message

Comment thread make/go.mk
Comment thread make/go.mk
Comment thread .golangci.json
@aravindtga aravindtga force-pushed the golangci-lint-go-run branch from 8affcc2 to 45dd652 Compare June 15, 2026 14:10
@aravindtga aravindtga marked this pull request as ready for review June 15, 2026 14:41
@aravindtga aravindtga requested a review from efiacor as a code owner June 15, 2026 14:41
Copilot AI review requested due to automatic review settings June 15, 2026 14:41

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 5 changed files in this pull request and generated 2 comments.

Comment thread make/go.mk
Comment thread .golangci.json
@dosubot dosubot Bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Jun 15, 2026
liamfallon
liamfallon previously approved these changes Jun 17, 2026
@dosubot dosubot Bot added the lgtm #ededed label Jun 17, 2026
@aravindtga aravindtga force-pushed the golangci-lint-go-run branch 2 times, most recently from 7e0de91 to 43bdccf Compare June 17, 2026 09:26
@aravindtga aravindtga self-assigned this Jun 17, 2026
Copilot AI review requested due to automatic review settings June 18, 2026 08:28
@aravindtga aravindtga force-pushed the golangci-lint-go-run branch from 43bdccf to 39cb709 Compare June 18, 2026 08:28
@aravindtga aravindtga requested review from a team June 18, 2026 08:28
@dosubot dosubot Bot added size:XS This PR changes 0-9 lines, ignoring generated files. and removed size:S This PR changes 10-29 lines, ignoring generated files. labels Jun 18, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 3 changed files in this pull request and generated 2 comments.

Comment thread make/go.mk
Comment thread .golangci.json
@aravindtga aravindtga force-pushed the golangci-lint-go-run branch from 39cb709 to 0287886 Compare June 18, 2026 08:57
@dosubot dosubot Bot added size:S This PR changes 10-29 lines, ignoring generated files. and removed size:XS This PR changes 0-9 lines, ignoring generated files. labels Jun 18, 2026
Signed-off-by: Aravindhan Ayyanathan <aravindhan.a@est.tech>
Copilot AI review requested due to automatic review settings June 18, 2026 09:53
@aravindtga aravindtga force-pushed the golangci-lint-go-run branch from 0287886 to 82bfda6 Compare June 18, 2026 09:53
@aravindtga aravindtga requested a review from a team June 18, 2026 09:53

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 3 changed files in this pull request and generated no new comments.

@sonarqubecloud

Copy link
Copy Markdown

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

Labels

lgtm #ededed size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants