Skip to content

Commit

Permalink
Add nolintlint linter (#5508)
Browse files Browse the repository at this point in the history
## Which problem is this PR solving?
- It flags unused nolint directive comments

## Description of the changes
- Add linter and remove ineffective nolint directives

## How was this change tested?
- `make lint`

Signed-off-by: Yuri Shkuro <github@ysh.us>
  • Loading branch information
yurishkuro authored Jun 3, 2024
1 parent b38d2f9 commit fd1b39e
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 5 deletions.
3 changes: 3 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 0 additions & 2 deletions cmd/agent/app/reporter/grpc/reporter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down Expand Up @@ -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())
Expand Down
1 change: 0 additions & 1 deletion cmd/jaeger/internal/extension/jaegerstorage/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 0 additions & 2 deletions storage/spanstore/downsampling_writer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand All @@ -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())
}

Expand Down

0 comments on commit fd1b39e

Please sign in to comment.