From b3aef996e2232c85ee396c441360462865389957 Mon Sep 17 00:00:00 2001 From: Dominic Evans Date: Mon, 3 Feb 2025 11:33:39 +0000 Subject: [PATCH] fix(ci): update ignore directives for staticcheck Switch golangci-lint nolint:unused to staticcheck lint:ignore style Signed-off-by: Dominic Evans --- balance_strategy.go | 10 +++++----- metrics_helpers_test.go | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/balance_strategy.go b/balance_strategy.go index b5bc30a13..5946c962f 100644 --- a/balance_strategy.go +++ b/balance_strategy.go @@ -989,7 +989,7 @@ func (p *partitionMovements) getTheActualPartitionToBeMoved(partition topicParti return reversePairPartition } -//nolint:unused // this is used but only in unittests as a helper (which are excluded by the integration build tag) +//lint:ignore U1000 // this is used but only in unittests as a helper (which are excluded by the integration build tag) func (p *partitionMovements) isLinked(src, dst string, pairs []consumerPair, currentPath []string) ([]string, bool) { if src == dst { return currentPath, false @@ -1024,7 +1024,7 @@ func (p *partitionMovements) isLinked(src, dst string, pairs []consumerPair, cur return currentPath, false } -//nolint:unused // this is used but only in unittests as a helper (which are excluded by the integration build tag) +//lint:ignore U1000 // this is used but only in unittests as a helper (which are excluded by the integration build tag) func (p *partitionMovements) in(cycle []string, cycles [][]string) bool { superCycle := make([]string, len(cycle)-1) for i := 0; i < len(cycle)-1; i++ { @@ -1039,7 +1039,7 @@ func (p *partitionMovements) in(cycle []string, cycles [][]string) bool { return false } -//nolint:unused // this is used but only in unittests as a helper (which are excluded by the integration build tag) +//lint:ignore U1000 // this is used but only in unittests as a helper (which are excluded by the integration build tag) func (p *partitionMovements) hasCycles(pairs []consumerPair) bool { cycles := make([][]string, 0) for _, pair := range pairs { @@ -1071,7 +1071,7 @@ func (p *partitionMovements) hasCycles(pairs []consumerPair) bool { return false } -//nolint:unused // this is used but only in unittests as a helper (which are excluded by the integration build tag) +//lint:ignore U1000 // this is used but only in unittests as a helper (which are excluded by the integration build tag) func (p *partitionMovements) isSticky() bool { for topic, movements := range p.PartitionMovementsByTopic { movementPairs := make([]consumerPair, len(movements)) @@ -1089,7 +1089,7 @@ func (p *partitionMovements) isSticky() bool { return true } -//nolint:unused // this is used but only in unittests as a helper (which are excluded by the integration build tag) +//lint:ignore U1000 // this is used but only in unittests as a helper (which are excluded by the integration build tag) func indexOfSubList(source []string, target []string) int { targetSize := len(target) maxCandidate := len(source) - targetSize diff --git a/metrics_helpers_test.go b/metrics_helpers_test.go index 14c5719e4..4682147f1 100644 --- a/metrics_helpers_test.go +++ b/metrics_helpers_test.go @@ -116,7 +116,7 @@ func minCountHistogramValidator(name string, minCount int) *metricValidator { }) } -//nolint:unused // this is used but only in unittests which are excluded by the integration build tag +//lint:ignore U1000 // this is used but only in unittests which are excluded by the integration build tag func minMaxHistogramValidator(name string, expectedMin int, expectedMax int) *metricValidator { return histogramValidator(name, func(t *testing.T, histogram metrics.Histogram) { t.Helper()