Skip to content

Use golangci-lint v2, migrate config and adjust Makefile#4477

Merged
efiacor merged 5 commits intokptdev:mainfrom
nokia:lint-v2
Apr 15, 2026
Merged

Use golangci-lint v2, migrate config and adjust Makefile#4477
efiacor merged 5 commits intokptdev:mainfrom
nokia:lint-v2

Conversation

@mozesl-nokia
Copy link
Copy Markdown
Contributor

Part of #4389

Migrated to golangci-lint v2 (specifically v2.11.4), fixed some new linter issues and adjusted the Makefile.

Signed-off-by: Mózes László Máté <laszlo.mozes@nokia.com>
Signed-off-by: Mózes László Máté <laszlo.mozes@nokia.com>
Signed-off-by: Mózes László Máté <laszlo.mozes@nokia.com>
Signed-off-by: Mózes László Máté <laszlo.mozes@nokia.com>
Copilot AI review requested due to automatic review settings April 13, 2026 13:51
@dosubot dosubot Bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Apr 13, 2026
@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 13, 2026

Deploy Preview for kptdocs ready!

Name Link
🔨 Latest commit 0963f9f
🔍 Latest deploy log https://app.netlify.com/projects/kptdocs/deploys/69dcffd09ac5a200089b083c
😎 Deploy Preview https://deploy-preview-4477--kptdocs.netlify.app
📱 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.

@dosubot dosubot Bot added the go Pull requests that update Go code label Apr 13, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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.

Migrates the repo to golangci-lint v2 and updates the lint configuration/Makefile, along with a set of small Go code refactors to satisfy new/updated linter checks.

Changes:

  • Update .golangci.yml to the v2 config format and adjust enabled linters/exclusions.
  • Update Makefile to install/run golangci-lint v2 and add a conditional path to use a local binary when available.
  • Apply lint-driven refactors/cleanups across multiple Go packages (simplified boolean logic, metadata field access, and fmt.Fprintf usage with builders).

Reviewed changes

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

Show a summary per file
File Description
pkg/wasm/client.go Adjusts the image push reference used for remote.Write.
pkg/live/rgstream.go Fixes Kptfile type detection by comparing the correct TypeMeta field.
pkg/live/rgpath.go Removes a nolint directive/comment near kyamlNodeToUnstructured.
pkg/live/planner/cluster.go Simplifies action-type filtering boolean logic.
pkg/lib/errors/resolver/live.go Replaces Sprintf+WriteString with Fprintf into a builder.
pkg/api/kptfile/v1/validation.go Replaces Sprintf+WriteString with Fprintf into a builder.
internal/util/update/update.go Simplifies negated equality boolean expression.
internal/util/strings/strings.go Switches to fmt.Fprintf into a builder for quoted joins.
internal/testutil/pkgbuilder/builder.go Uses promoted metadata fields (Name, Namespace, etc.) instead of ObjectMeta.*.
internal/pkg/pkg.go Simplifies ResourceGroup filter boolean logic.
internal/fnruntime/fnerrors.go Replaces Sprintf+WriteString with Fprintf into a builder.
commands/live/migrate/migratecmd_test.go Updates tests to use promoted metadata fields (Namespace, Name, Labels).
commands/alpha/live/plan/command.go Simplifies output-format validation boolean logic.
Makefile Pins golangci-lint v2, adds bash shell settings, and changes lint to use local binary when matching version.
.golangci.yml Migrates golangci-lint config to v2 schema; updates linters, settings, and exclusion rules/paths.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pkg/wasm/client.go
Comment thread Makefile
Comment thread Makefile
Comment thread internal/util/strings/strings.go Outdated
Copilot AI review requested due to automatic review settings April 13, 2026 14:37
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Mózes László Máté <laszlo.mozes@nokia.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 migrates the project to golangci-lint v2 (v2.11.4), updates lint configuration to the v2 schema, and applies code tweaks needed to satisfy new/updated linters.

Changes:

  • Update Makefile to install/run golangci-lint v2.11.4 and optimize make lint execution.
  • Migrate .golangci.yml to golangci-lint v2 configuration format, including formatter configuration and exclusions.
  • Apply small refactors across Go code to satisfy new lint rules (e.g., boolean logic simplifications, more efficient string building, struct field promotion).

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
pkg/wasm/client.go Update push reference construction for remote image write.
pkg/live/rgstream.go Adjust Kptfile type detection to match updated struct shape.
pkg/live/rgpath.go Remove prior //nolint:interfacer suppression.
pkg/live/planner/cluster.go Simplify action filtering boolean logic.
pkg/lib/errors/resolver/live.go Replace Sprintf+WriteString with Fprintf to builder.
pkg/api/kptfile/v1/validation.go Use Fprintf for error string assembly.
internal/util/update/update.go Simplify boolean expression.
internal/util/strings/strings.go Use strconv.Quote instead of fmt.Sprintf("%q", ...).
internal/testutil/pkgbuilder/builder.go Use promoted metadata fields (Name, Namespace, etc.).
internal/pkg/pkg.go Simplify boolean logic for ResourceGroup filtering.
internal/fnruntime/fnerrors.go Use Fprintf for builder formatting.
commands/live/migrate/migratecmd_test.go Update tests to use promoted metadata fields.
commands/alpha/live/plan/command.go Simplify output-format validation boolean logic.
Makefile Add golangci-lint v2 version pin + conditional invocation logic.
.golangci.yml Migrate configuration to golangci-lint v2 schema; add formatter config and updated exclusions.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Makefile
@dosubot dosubot Bot added the lgtm label Apr 14, 2026
@efiacor efiacor merged commit 708477c into kptdev:main Apr 15, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

go Pull requests that update Go code lgtm size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants