Skip to content

Commit

Permalink
[chore]: enable useless-assert rule from testifylint (open-telemetry#…
Browse files Browse the repository at this point in the history
…35219)

#### Description

Testifylint is a linter that provides best practices with the use of
testify.

This PR enables
[useless-assert](https://github.com/Antonboom/testifylint?tab=readme-ov-file#useless-assert)
rule from [testifylint](https://github.com/Antonboom/testifylint)

Signed-off-by: Matthieu MOREL <[email protected]>
  • Loading branch information
mmorel-35 authored and jriguera committed Oct 4, 2024
1 parent 1e03d5a commit d2eb516
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 6 deletions.
1 change: 0 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,6 @@ linters-settings:
- float-compare
- require-error
- suite-subtest-run
- useless-assert
enable-all: true

linters:
Expand Down
2 changes: 1 addition & 1 deletion Makefile.Common
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ GOTESTSUM := $(TOOLS_BIN_DIR)/gotestsum
TESTIFYLINT := $(TOOLS_BIN_DIR)/testifylint

GOTESTSUM_OPT?= --rerun-fails=1
TESTIFYLINT_OPT?= --enable-all --disable=float-compare,require-error,suite-subtest-run,useless-assert
TESTIFYLINT_OPT?= --enable-all --disable=float-compare,require-error,suite-subtest-run

# BUILD_TYPE should be one of (dev, release).
BUILD_TYPE?=release
Expand Down
2 changes: 0 additions & 2 deletions exporter/kineticaexporter/exporter_metric_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ func TestExporter_pushMetricsData(t *testing.T) {
t.Run("push success", func(t *testing.T) {
exporter := newTestMetricsExporter(t)
mustPushMetricsData(t, exporter, simpleMetrics(3))

require.Equal(t, 15, 15)
})
}

Expand Down
1 change: 0 additions & 1 deletion extension/storage/filestorage/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ func TestClientBatchOperations(t *testing.T) {
// Make sure nothing is there
err = client.Batch(ctx, testGetEntries...)
require.NoError(t, err)
require.Equal(t, testGetEntries, testGetEntries)

// Set it
err = client.Batch(ctx, testSetEntries...)
Expand Down
1 change: 0 additions & 1 deletion pkg/translator/opencensus/resource_to_oc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,6 @@ func TestResourceToOCAndBack(t *testing.T) {
assert.Equal(t, strconv.FormatInt(v.Int(), 10), a.Str())
}
case pcommon.ValueTypeMap, pcommon.ValueTypeSlice:
assert.Equal(t, a, a)
default:
assert.Equal(t, v, a)
}
Expand Down

0 comments on commit d2eb516

Please sign in to comment.