build(deps): update dependency golangci/golangci-lint to v2.12.1#1092
build(deps): update dependency golangci/golangci-lint to v2.12.1#1092renovate[bot] wants to merge 2 commits intomainfrom
Conversation
019aac9 to
933a631
Compare
933a631 to
0d764b0
Compare
0d764b0 to
70688e3
Compare
70688e3 to
17480bb
Compare
17480bb to
2791a42
Compare
2791a42 to
e357923
Compare
e357923 to
86346f7
Compare
86346f7 to
ffcf7dc
Compare
ffcf7dc to
1aefddb
Compare
1aefddb to
7a36f42
Compare
There was a problem hiding this comment.
Pull request overview
This PR updates the repository’s Go linting toolchain to golangci-lint v2.12.1 and adjusts the codebase/config to satisfy newly enabled or updated linters (notably paralleltest and sloglint context-only logging), alongside some Go 1.18+ modernizations (any).
Changes:
- Bump golangci-lint version to
v2.12.1(Makefile + CI workflow) and refresh.golangci.ymlto match the updated “golden config” and new linters. - Update many tests to run in parallel (or explicitly
//nolint:paralleltestwhere parallelism is unsafe). - Update logging calls to context-aware
slogAPIs (InfoContext/WarnContext/ErrorContext) and apply minor type modernizations (any).
Reviewed changes
Copilot reviewed 66 out of 66 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| test/e2e/workloadscan_test.go | Adds //nolint:paralleltest rationale for shared Kind cluster. |
| test/e2e/registry_scan_test.go | Adds //nolint:paralleltest rationale for shared Kind cluster. |
| Makefile | Bumps GOLANGCI_LINT_VERSION to v2.12.1. |
| internal/webhook/v1alpha1/workloadscanconfiguration_webhook_test.go | Adds t.Parallel() at test and subtest levels. |
| internal/webhook/v1alpha1/scanjob_webhook_test.go | Adds t.Parallel() at test and subtest levels. |
| internal/webhook/v1alpha1/registry_webhook_test.go | Adds t.Parallel() at test and subtest levels. |
| internal/webhook/v1alpha1/registry_validators_test.go | Adds t.Parallel() at test and subtest levels. |
| internal/storage/workloadscanreport_watcher_test.go | Runs testify suite test in parallel. |
| internal/storage/workloadscanreport_strategy_test.go | Adds t.Parallel() at test and subtest levels. |
| internal/storage/workloadscanreport_registry_store.go | Uses []any for table row cells. |
| internal/storage/transform.go | Switches transform function signatures to any. |
| internal/storage/transform_test.go | Adds t.Parallel() to unit tests. |
| internal/storage/table_convertor.go | Uses []any return types for cell lists. |
| internal/storage/store_test.go | Adds t.Parallel() to suite test; adjusts pointer creation in tests (currently broken). |
| internal/storage/repository/workloadscanreport_repository.go | Formatting-only (blank line in struct). |
| internal/storage/repository/workloadscanreport_repository_test.go | Runs suite and table-driven tests in parallel. |
| internal/storage/repository/generic_object_repository_test.go | Runs suite test in parallel. |
| internal/messaging/subscriber_test.go | Adds t.Parallel() to tests and subtests. |
| internal/messaging/publisher_test.go | Adds t.Parallel() to tests. |
| internal/mcp/server_test.go | Runs testify suites in parallel. |
| internal/mcp/middlewares.go | Uses WarnContext for unauthorized requests. |
| internal/mcp/middlewares_test.go | Adds t.Parallel() to tests and subtests. |
| internal/handlers/trivyreport/trivy_test.go | Adds t.Parallel() to tests and subtests. |
| internal/handlers/scanjob_failure_test.go | Adds t.Parallel(); switches to runtime.NewScheme() instead of generated scheme. |
| internal/handlers/scan_sbom.go | Uses context-aware slog calls during cleanup/logging. |
| internal/handlers/scan_sbom_test.go | Adds //nolint:paralleltest notes; switches to runtime.NewScheme(). |
| internal/handlers/messages.go | Formatting-only (blank lines in structs). |
| internal/handlers/generate_sbom.go | Uses context-aware slog calls during cleanup/logging. |
| internal/handlers/generate_sbom_test.go | Adds //nolint:paralleltest notes; switches to runtime.NewScheme(). |
| internal/handlers/dockerauth/auth_test.go | Adds //nolint:paralleltest notes due to global env var usage. |
| internal/handlers/create_catalog.go | Uses context-aware slog calls during cleanup/logging. |
| internal/handlers/create_catalog_test.go | Adds //nolint:paralleltest notes; switches to runtime.NewScheme(); parallelizes safe tests. |
| internal/filters/tag_test.go | Adds t.Parallel() to tests and subtests. |
| internal/filters/platform_test.go | Adds t.Parallel() to tests and subtests. |
| internal/controller/workloadscan_watch_helpers_test.go | Adds t.Parallel() to tests and subtests. |
| internal/controller/workloadscan_controller.go | Formatting-only (blank line in struct). |
| internal/controller/workloadscan_controller_test.go | Adds t.Parallel() and adjusts bool pointer creation (currently broken). |
| internal/controller/vulnerabilityreport_controller.go | Formatting-only (blank line in struct). |
| internal/controller/vulnerabilityreport_controller_test.go | Adjusts manager options bool pointer creation (currently broken). |
| internal/controller/transform.go | Switches transform function signature to any. |
| internal/controller/transform_test.go | Adds t.Parallel() to unit test. |
| internal/controller/suite_test.go | Runs ginkgo suite in parallel. |
| internal/controller/scanjob_controller.go | Formatting-only (blank line in struct). |
| internal/controller/registry_scan_runner_test.go | Adds t.Parallel() to tests and subtests. |
| internal/controller/indexer_test.go | Adds t.Parallel() to tests and subtests. |
| internal/controller/image_workloadscan_watch_helpers_test.go | Adds t.Parallel() to tests and subtests. |
| internal/controller/image_workloadscan_controller_test.go | Adjusts manager options bool pointer creation (currently broken). |
| internal/cmdutil/bootstrap.go | Uses InfoContext in retry logging. |
| internal/cel/tag.go | Uses map[string]any for CEL eval input. |
| internal/cel/tag_test.go | Adds t.Parallel() to tests and subtests. |
| internal/apiserver/database_checker.go | Uses DebugContext for request-scoped logging. |
| internal/apiserver/admission/workloadscanreport.go | Formatting-only (blank line in struct). |
| internal/apiserver/admission/workloadscanreport_test.go | Adds t.Parallel() to tests and subtests. |
| cmd/controller/main.go | Adjusts cache options; bool pointer creation is currently invalid (new(true)). |
| api/v1alpha1/workloadscanconfiguration_types.go | Formatting-only (blank line before Items). |
| api/v1alpha1/vexhub_types.go | Formatting-only (blank line before Items). |
| api/v1alpha1/scanjob_types.go | Formatting-only (blank line before Items). |
| api/v1alpha1/registry_types.go | Formatting-only (blank line before Items). |
| api/v1alpha1/registry_types_test.go | Adds t.Parallel() to tests and subtests. |
| api/storage/v1alpha1/workloadscanreport_types.go | Formatting-only (blank line before Items). |
| api/storage/v1alpha1/vulnerabilityreport_types.go | Formatting-only (blank line before Items). |
| api/storage/v1alpha1/summary_test.go | Adds t.Parallel() to test. |
| api/storage/v1alpha1/sbom_types.go | Formatting-only (blank lines / field alignment). |
| api/storage/v1alpha1/image_types.go | Formatting-only (blank lines / field grouping). |
| .golangci.yml | Updates “golden config” header and enables/configures new/updated linters (incl. paralleltest). |
| .github/workflows/ci.yml | Updates golangci-lint action version input to v2.12.1. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| }: { | ||
| // Read-only | ||
| UnsafeDisableDeepCopy: ptr.To(true), | ||
| UnsafeDisableDeepCopy: new(true), | ||
| }, |
| APIVersion: "apps/v1", | ||
| Kind: "ReplicaSet", | ||
| Name: "my-rs", | ||
| UID: "rs-uid", | ||
| Controller: ptr.To(true), | ||
| Controller: new(true), | ||
| }, |
| mgr, err := ctrl.NewManager(cfg, ctrl.Options{ | ||
| Scheme: k8sClient.Scheme(), | ||
| Controller: config.Controller{ | ||
| SkipNameValidation: ptr.Bool(true), | ||
| SkipNameValidation: new(true), | ||
| }, |
| mgr, err := ctrl.NewManager(cfg, ctrl.Options{ | ||
| Scheme: k8sClient.Scheme(), | ||
| Controller: config.Controller{ | ||
| SkipNameValidation: ptr.Bool(true), | ||
| SkipNameValidation: new(true), | ||
| }, |
| tryUpdate := func(input runtime.Object, _ k8sstorage.ResponseMeta) (runtime.Object, *uint64, error) { | ||
| return input, ptr.To(uint64(0)), nil | ||
| return input, new(uint64(0)), nil | ||
| } |
| opts := k8sstorage.ListOptions{ | ||
| SendInitialEvents: ptr.To(true), | ||
| SendInitialEvents: new(true), | ||
| Predicate: predicate, |
| if err = os.Remove(reportFile.Name()); err != nil { | ||
| h.logger.Error("failed to remove temporary repoort file", "error", err) | ||
| h.logger.ErrorContext(ctx, "failed to remove temporary repoort file", "error", err) | ||
| } |
| if !ok { | ||
| return nil, ptr.To(uint64(0)), errors.New("input is not of type *v1alpha1.SBOM") | ||
| return nil, new(uint64(0)), errors.New("input is not of type *v1alpha1.SBOM") | ||
| } | ||
|
|
||
| sbom.SPDX.Raw = []byte(`{"foo": "bar"}`) | ||
|
|
||
| return input, ptr.To(uint64(0)), nil | ||
| return input, new(uint64(0)), nil |
Edited/Blocked NotificationRenovate will not automatically rebase this PR, because it does not recognize the last commit author and assumes somebody else may have edited the PR. You can manually request rebase by checking the rebase/retry box above. |
This PR contains the following updates:
v2.11.4→v2.12.1Warning
Some dependencies could not be looked up. Check the Dependency Dashboard for more information.
Release Notes
golangci/golangci-lint (golangci/golangci-lint)
v2.12.1Compare Source
Released on 2026-05-01
gomodguard_v2: fix panic with migration suggestioninstall.shscript (if you are still using an URL based on the branchmaster, please update to usehttps://golangci-lint.run/install.sh)v2.12.0Compare Source
Released on 2026-05-01
clickhouselintlinter https://github.com/ClickHouse/clickhouse-go-linterdupl: fromf665c8dtoc99c5cf(extended detection)funcorder: from 0.5.0 to 0.6.0 (new option:function)goconst: add an option to ignore strings from testsgoconst: from 1.8.2 to 1.10.0 (extended detection)gomodguard_v2: from 1.4.1 to 2.1.0 (major version with new configuration)gosec: from619ce21to 2.26.1 (new checks:G124,G708,G709,G710)govet: addinlineanalyzermakezero: from 2.1.0 to 2.2.1 (support slice type aliases)paralleltest: exposecheckcleanupoptionsloglint: from 0.11.1 to 0.12.0 (new options:allowed-keys,custom-funcs)wsl_v5: from 5.6.0 to 5.8.0 (new option:cuddle-max-statements; new checks:after-decl,after-defer,after-expr,after-go,cuddle-group)forbidigo: from 2.3.0 to 2.3.1godot: from 1.5.4 to 1.5.6govet-modernize: from 0.43.0 to 0.44.0ireturn: from 0.4.0 to 0.4.1rowserrcheck: from 1.1.1 toc5f79b8customcommandConfiguration
📅 Schedule: (UTC)
* * * * 0,6)🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.