From f0f6bf166791e4a1d20b98a28332d08e8659772c Mon Sep 17 00:00:00 2001 From: Yuri Shkuro Date: Sun, 2 Jun 2024 18:36:48 -0400 Subject: [PATCH] Add nolintlint linter Signed-off-by: Yuri Shkuro --- .golangci.yml | 3 +++ cmd/agent/app/reporter/grpc/reporter_test.go | 2 -- cmd/jaeger/internal/extension/jaegerstorage/config.go | 1 - storage/spanstore/downsampling_writer_test.go | 2 -- 4 files changed, 3 insertions(+), 5 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 03322ddd264..4fc8712d020 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -86,6 +86,9 @@ linters: # Finds sending HTTP request without context.Context. - noctx + # Reports ill-formed or insufficient nolint directives. + - nolintlint + # Fast, configurable, extensible, flexible, and beautiful linter for Go. Drop-in replacement of golint. - revive diff --git a/cmd/agent/app/reporter/grpc/reporter_test.go b/cmd/agent/app/reporter/grpc/reporter_test.go index 7d901134784..4a679cca8a7 100644 --- a/cmd/agent/app/reporter/grpc/reporter_test.go +++ b/cmd/agent/app/reporter/grpc/reporter_test.go @@ -60,7 +60,6 @@ func TestReporter_EmitZipkinBatch(t *testing.T) { }) defer s.Stop() conn, err := grpc.NewClient(addr.String(), grpc.WithTransportCredentials(insecure.NewCredentials())) - //nolint:staticcheck // don't care about errors require.NoError(t, err) defer conn.Close() @@ -103,7 +102,6 @@ func TestReporter_EmitBatch(t *testing.T) { }) defer s.Stop() conn, err := grpc.NewClient(addr.String(), grpc.WithTransportCredentials(insecure.NewCredentials())) - //nolint:staticcheck // don't care about errors require.NoError(t, err) defer conn.Close() rep := NewReporter(conn, nil, zap.NewNop()) diff --git a/cmd/jaeger/internal/extension/jaegerstorage/config.go b/cmd/jaeger/internal/extension/jaegerstorage/config.go index 1e6128cda93..3fde1327c32 100644 --- a/cmd/jaeger/internal/extension/jaegerstorage/config.go +++ b/cmd/jaeger/internal/extension/jaegerstorage/config.go @@ -34,7 +34,6 @@ type MemoryStorage struct { func (cfg *Config) Validate() error { emptyCfg := createDefaultConfig().(*Config) - //nolint:govet // The remoteRPCClient field in GRPC.Configuration contains error type if reflect.DeepEqual(*cfg, *emptyCfg) { return fmt.Errorf("%s: no storage type present in config", ID) } else { diff --git a/storage/spanstore/downsampling_writer_test.go b/storage/spanstore/downsampling_writer_test.go index aaa085c69eb..42c3b0a7c70 100644 --- a/storage/spanstore/downsampling_writer_test.go +++ b/storage/spanstore/downsampling_writer_test.go @@ -70,7 +70,6 @@ func TestDownSamplingWriter_hashBytes(t *testing.T) { } c := NewDownsamplingWriter(&noopWriteSpanStore{}, downsamplingOptions) h := c.sampler.hasherPool.Get().(*hasher) - //nolint:testifylint assert.Equal(t, h.hashBytes(), h.hashBytes()) c.sampler.hasherPool.Put(h) trace := model.TraceID{ @@ -82,7 +81,6 @@ func TestDownSamplingWriter_hashBytes(t *testing.T) { } _, _ = span.TraceID.MarshalTo(h.buffer) // Same traceID should always be hashed to same uint64 in DownSamplingWriter. - //nolint:testifylint assert.Equal(t, h.hashBytes(), h.hashBytes()) }