From 1a79bee91183b975d2180be3612743e8ce415bdb Mon Sep 17 00:00:00 2001 From: Christoph Kleineweber Date: Mon, 6 May 2024 16:05:53 +0200 Subject: [PATCH] chore: Adapt .golangci.yaml for v1.58.0 (#1040) --- .golangci.yaml | 6 ++++-- apis/operator/v1alpha1/telemetry_types.go | 2 +- apis/telemetry/v1alpha1/logparser_types.go | 2 +- apis/telemetry/v1alpha1/logpipeline_types.go | 2 +- apis/telemetry/v1alpha1/metricpipeline_types.go | 2 +- apis/telemetry/v1alpha1/tracepipeline_types.go | 2 +- apis/telemetry/v1beta1/logpipeline_types.go | 2 +- apis/telemetry/v1beta1/metricpipeline_types.go | 2 +- apis/telemetry/v1beta1/tracepipeline_types.go | 2 +- main.go | 2 +- 10 files changed, 13 insertions(+), 11 deletions(-) diff --git a/.golangci.yaml b/.golangci.yaml index a538ffe58..99f6318d1 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -17,6 +17,8 @@ linters: - scopelint - structcheck - varcheck + - gomnd + - execinquery # Linters to be enabled after fixing the issues - intrange - cyclop @@ -30,9 +32,9 @@ linters: - gocritic - godot - godox - - goerr113 + - err113 - gofumpt - - gomnd + - mnd - ireturn - lll - maintidx diff --git a/apis/operator/v1alpha1/telemetry_types.go b/apis/operator/v1alpha1/telemetry_types.go index d18f7ccd8..c02d33256 100644 --- a/apis/operator/v1alpha1/telemetry_types.go +++ b/apis/operator/v1alpha1/telemetry_types.go @@ -142,7 +142,7 @@ type TelemetryList struct { Items []Telemetry `json:"items"` } -//nolint:gochecknoinits // SchemeBuilder's registration is required. +//nolint:init // SchemeBuilder's registration is required. func init() { SchemeBuilder.Register(&Telemetry{}, &TelemetryList{}) } diff --git a/apis/telemetry/v1alpha1/logparser_types.go b/apis/telemetry/v1alpha1/logparser_types.go index 5d0f2e93a..989f1d5ef 100644 --- a/apis/telemetry/v1alpha1/logparser_types.go +++ b/apis/telemetry/v1alpha1/logparser_types.go @@ -61,7 +61,7 @@ type LogParserStatus struct { Conditions []metav1.Condition `json:"conditions,omitempty"` } -//nolint:gochecknoinits // SchemeBuilder's registration is required. +//nolint:init // SchemeBuilder's registration is required. func init() { SchemeBuilder.Register(&LogParser{}, &LogParserList{}) } diff --git a/apis/telemetry/v1alpha1/logpipeline_types.go b/apis/telemetry/v1alpha1/logpipeline_types.go index c3e1f1d92..e3e8a9ab6 100644 --- a/apis/telemetry/v1alpha1/logpipeline_types.go +++ b/apis/telemetry/v1alpha1/logpipeline_types.go @@ -227,7 +227,7 @@ type LogPipelineList struct { Items []LogPipeline `json:"items"` } -//nolint:gochecknoinits // SchemeBuilder's registration is required. +//nolint:init // SchemeBuilder's registration is required. func init() { SchemeBuilder.Register(&LogPipeline{}, &LogPipelineList{}) } diff --git a/apis/telemetry/v1alpha1/metricpipeline_types.go b/apis/telemetry/v1alpha1/metricpipeline_types.go index 5d84ae320..c997d49e6 100644 --- a/apis/telemetry/v1alpha1/metricpipeline_types.go +++ b/apis/telemetry/v1alpha1/metricpipeline_types.go @@ -20,7 +20,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) -//nolint:gochecknoinits // SchemeBuilder's registration is required. +//nolint:init // SchemeBuilder's registration is required. func init() { SchemeBuilder.Register(&MetricPipeline{}, &MetricPipelineList{}) } diff --git a/apis/telemetry/v1alpha1/tracepipeline_types.go b/apis/telemetry/v1alpha1/tracepipeline_types.go index 701f145e7..0843bb595 100644 --- a/apis/telemetry/v1alpha1/tracepipeline_types.go +++ b/apis/telemetry/v1alpha1/tracepipeline_types.go @@ -64,7 +64,7 @@ type TracePipelineList struct { Items []TracePipeline `json:"items"` } -//nolint:gochecknoinits // SchemeBuilder's registration is required. +//nolint:init // SchemeBuilder's registration is required. func init() { SchemeBuilder.Register(&TracePipeline{}, &TracePipelineList{}) } diff --git a/apis/telemetry/v1beta1/logpipeline_types.go b/apis/telemetry/v1beta1/logpipeline_types.go index 950f03933..1d5ad5fba 100644 --- a/apis/telemetry/v1beta1/logpipeline_types.go +++ b/apis/telemetry/v1beta1/logpipeline_types.go @@ -181,7 +181,7 @@ type LogPipelineList struct { Items []LogPipeline `json:"items"` } -//nolint:gochecknoinits // SchemeBuilder's registration is required. +//nolint:init // SchemeBuilder's registration is required. func init() { SchemeBuilder.Register(&LogPipeline{}, &LogPipelineList{}) } diff --git a/apis/telemetry/v1beta1/metricpipeline_types.go b/apis/telemetry/v1beta1/metricpipeline_types.go index d36a4531d..098a5b90c 100644 --- a/apis/telemetry/v1beta1/metricpipeline_types.go +++ b/apis/telemetry/v1beta1/metricpipeline_types.go @@ -146,7 +146,7 @@ type MetricPipelineList struct { Items []MetricPipeline `json:"items"` } -//nolint:gochecknoinits // SchemeBuilder's registration is required. +//nolint:init // SchemeBuilder's registration is required. func init() { SchemeBuilder.Register(&MetricPipeline{}, &MetricPipelineList{}) } diff --git a/apis/telemetry/v1beta1/tracepipeline_types.go b/apis/telemetry/v1beta1/tracepipeline_types.go index ce81aa154..99faaa34a 100644 --- a/apis/telemetry/v1beta1/tracepipeline_types.go +++ b/apis/telemetry/v1beta1/tracepipeline_types.go @@ -66,7 +66,7 @@ type TracePipelineList struct { Items []TracePipeline `json:"items"` } -//nolint:gochecknoinits // SchemeBuilder's registration is required. +//nolint:init // SchemeBuilder's registration is required. func init() { SchemeBuilder.Register(&TracePipeline{}, &TracePipelineList{}) } diff --git a/main.go b/main.go index c25d9d0ef..82d31ecdb 100644 --- a/main.go +++ b/main.go @@ -156,7 +156,7 @@ const ( selfMonitorName = "telemetry-self-monitor" ) -//nolint:gochecknoinits // Runtime's scheme addition is required. +//nolint:init // Runtime's scheme addition is required. func init() { utilruntime.Must(clientgoscheme.AddToScheme(scheme)) utilruntime.Must(apiextensionsv1.AddToScheme(scheme))