Skip to content

Commit 6d7b22c

Browse files
authored
[chore]: enable empty-lines rule from revive (#4783)
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
1 parent 9439cbe commit 6d7b22c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+1
-90
lines changed

.golangci.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,6 @@ linters:
8484
disabled: true # FIXME
8585
- name: empty-block
8686
disabled: true
87-
- name: empty-lines
88-
disabled: true # FIXME
8987
- name: enforce-switch-style
9088
disabled: true # FIXME
9189
- name: error-naming
@@ -180,6 +178,7 @@ linters:
180178
- staticcheck
181179
- unparam
182180
- unused
181+
- whitespace
183182
exclusions:
184183
generated: lax
185184
presets:

apis/v1alpha1/opampbridge_webhook_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,6 @@ func TestOpAMPBridgeDefaultingWebhook(t *testing.T) {
112112
}
113113

114114
func TestOpAMPBridgeValidatingWebhook(t *testing.T) {
115-
116115
two := int32(2)
117116

118117
tests := []struct {

apis/v1beta1/metrics.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,6 @@ func (m *Metrics) update(ctx context.Context, oldCollector *OpenTelemetryCollect
137137
}
138138

139139
func (m *Metrics) updateGeneralCRMetricsComponents(ctx context.Context, collector *OpenTelemetryCollector, up bool) {
140-
141140
inc := 1
142141
if !up {
143142
inc = -1
@@ -155,7 +154,6 @@ func (m *Metrics) updateComponentCounters(ctx context.Context, collector *OpenTe
155154
moveCounter(ctx, collector, components.processors, m.processorCounter, up)
156155
moveCounter(ctx, collector, components.extensions, m.extensionsCounter, up)
157156
moveCounter(ctx, collector, components.connectors, m.connectorsCounter, up)
158-
159157
}
160158

161159
func extractElements(elements map[string]any) []string {
@@ -178,7 +176,6 @@ func extractElements(elements map[string]any) []string {
178176
}
179177

180178
func getComponentsFromConfig(yamlContent Config) *componentDefinitions {
181-
182179
info := &componentDefinitions{
183180
receivers: extractElements(yamlContent.Receivers.Object),
184181
exporters: extractElements(yamlContent.Exporters.Object),

apis/v1beta1/metrics_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ var wantInstrumentationScope = instrumentation.Scope{
2525
}
2626

2727
func TestOTELCollectorCRDMetrics(t *testing.T) {
28-
2928
otelcollector1 := &OpenTelemetryCollector{
3029
ObjectMeta: metav1.ObjectMeta{
3130
Name: "collector1",
@@ -527,7 +526,6 @@ func checkCreate(t *testing.T, m *Metrics, collectors []*OpenTelemetryCollector,
527526
}
528527

529528
func checkUpdate(t *testing.T, m *Metrics, collectors []*OpenTelemetryCollector, reader metric.Reader) {
530-
531529
m.update(context.Background(), collectors[0], collectors[2])
532530

533531
rm := metricdata.ResourceMetrics{}

cmd/gather/cluster/cluster.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ func (c *Cluster) getOperatorDeployment() (appsv1.Deployment, error) {
7777
}
7878

7979
return operatorDeployments.Items[0], nil
80-
8180
}
8281

8382
func (c *Cluster) GetOperatorLogs() error {
@@ -157,7 +156,6 @@ func (c *Cluster) GetOLMInfo() error {
157156
}
158157
for _, o := range operators.Items {
159158
writeToFile(outputDir, &o)
160-
161159
}
162160

163161
// OperatorGroups
@@ -184,7 +182,6 @@ func (c *Cluster) GetOLMInfo() error {
184182
}
185183
for _, o := range subscriptions.Items {
186184
writeToFile(outputDir, &o)
187-
188185
}
189186

190187
// InstallPlan
@@ -386,7 +383,6 @@ func (c *Cluster) getOwnerResources(objList client.ObjectList, owner any) ([]cli
386383
}
387384
}
388385
return resources, nil
389-
390386
}
391387

392388
func (c *Cluster) processResourceType(list client.ObjectList, owner any, folder string) error {

cmd/gather/cluster/cluster_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,6 @@ func TestGetOperatorNamespace(t *testing.T) {
125125
}
126126

127127
func TestGetOperatorDeployment(t *testing.T) {
128-
129128
mockClient := new(MockClient)
130129
cfg := &config.Config{
131130
KubernetesClient: mockClient,
@@ -151,7 +150,6 @@ func TestGetOperatorDeployment(t *testing.T) {
151150
}
152151

153152
func TestGetOperatorDeploymentNotFound(t *testing.T) {
154-
155153
mockClient := new(MockClient)
156154
cfg := &config.Config{
157155
KubernetesClient: mockClient,

cmd/operator-opamp-bridge/internal/metrics/reporter.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ type MetricReporter struct {
4444
// TODO: do more validation on the endpoint, allow for gRPC.
4545
// TODO: set global provider and add more metrics to be reported.
4646
func NewMetricReporter(logger logr.Logger, dest *protobufs.TelemetryConnectionSettings, agentType string, agentVersion string, instanceId uuid.UUID) (*MetricReporter, error) {
47-
4847
if dest.DestinationEndpoint == "" {
4948
return nil, errors.New("metric destination must specify DestinationEndpoint")
5049
}

cmd/otel-allocator/benchmark_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ func BenchmarkProcessTargetsWithRelabelConfig(b *testing.B) {
9292
})
9393
}
9494
}
95-
9695
}
9796

9897
func prepareBenchmarkData(numTargets, targetsPerGroup, groupsPerJob int) map[string][]*targetgroup.Group {

cmd/otel-allocator/internal/allocation/allocator_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,6 @@ func TestAddingAndRemovingCollectors(t *testing.T) {
162162
// Tests that two targets with the same target url and job name but different label set are both added.
163163
func TestAllocationCollision(t *testing.T) {
164164
RunForAllStrategies(t, func(t *testing.T, allocator Allocator) {
165-
166165
cols := MakeNCollectors(3, 0)
167166
allocator.SetCollectors(cols)
168167
firstLabels := labels.New(labels.Label{Name: "test", Value: "test1"})

cmd/otel-allocator/internal/allocation/consistent_hashing.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ func (s *consistentHashingStrategy) SetCollectors(collectors map[string]*Collect
7070
}
7171

7272
s.consistentHasher = consistent.New(members, s.config)
73-
7473
}
7574

7675
func (s *consistentHashingStrategy) SetFallbackStrategy(fallbackStrategy Strategy) {}

0 commit comments

Comments
 (0)