Skip to content

Commit

Permalink
[chore]: enable error-is-as rule from testifylint (#6141)
Browse files Browse the repository at this point in the history
Testifylint is a linter that provides best practices with the use of
testify.

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

Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
Co-authored-by: Robert Pająk <pellared@hotmail.com>
  • Loading branch information
mmorel-35 and pellared authored Sep 24, 2024
1 parent ba09b97 commit c4e8bb3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
1 change: 0 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,6 @@ linters-settings:
enable-all: true
disable:
- compares
- error-is-as
- expected-actual
- float-compare
- formatter
Expand Down
7 changes: 3 additions & 4 deletions samplers/probability/consistent/tracestate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
package consistent

import (
"errors"
"strconv"
"strings"
"testing"
Expand Down Expand Up @@ -91,7 +90,7 @@ func TestParseTraceStateUnsampled(t *testing.T) {
require.False(t, otts.hasPValue(), "should have no p-value")

if test.expectErr != nil {
require.True(t, errors.Is(err, test.expectErr), "not expecting %v", err)
require.ErrorIs(t, err, test.expectErr, "not expecting %v", err)
}
if test.rval != notset {
require.True(t, otts.hasRValue())
Expand Down Expand Up @@ -168,7 +167,7 @@ func TestParseTraceStateSampled(t *testing.T) {
otts, err := parseOTelTraceState(test.in, true)

if test.expectErr != nil {
require.True(t, errors.Is(err, test.expectErr), "not expecting %v", err)
require.ErrorIs(t, err, test.expectErr, "not expecting %v", err)
} else {
require.NoError(t, err)
}
Expand Down Expand Up @@ -252,7 +251,7 @@ func TestParseTraceStateExtra(t *testing.T) {
otts, err := parseOTelTraceState(test.in, test.sampled)

if test.expectErr != nil {
require.True(t, errors.Is(err, test.expectErr), "not expecting %v", err)
require.ErrorIs(t, err, test.expectErr, "not expecting %v", err)
} else {
require.NoError(t, err)
}
Expand Down

0 comments on commit c4e8bb3

Please sign in to comment.