diff --git a/.golangci.yml b/.golangci.yml index f7bb319b40f1..d4ff9bcdfd02 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -133,6 +133,7 @@ linters: - revive - staticcheck - stylecheck + - testifylint - unconvert - unparam - unused @@ -213,4 +214,3 @@ issues: run: timeout: 5m - diff --git a/pkg/golinters/misspell_test.go b/pkg/golinters/misspell_test.go index 29e0862f9b83..5c590ef97e5c 100644 --- a/pkg/golinters/misspell_test.go +++ b/pkg/golinters/misspell_test.go @@ -29,7 +29,7 @@ func Test_appendExtraWords(t *testing.T) { expected := []string{"iff", "if", "cancelation", "cancellation"} - assert.Equal(t, replacer.Replacements, expected) + assert.Equal(t, expected, replacer.Replacements) } func Test_appendExtraWords_error(t *testing.T) { diff --git a/pkg/result/processors/autogenerated_exclude_test.go b/pkg/result/processors/autogenerated_exclude_test.go index 26cead18892a..b2a51caf28b1 100644 --- a/pkg/result/processors/autogenerated_exclude_test.go +++ b/pkg/result/processors/autogenerated_exclude_test.go @@ -252,6 +252,7 @@ func Test_shouldPassIssue_error(t *testing.T) { pass, err := p.shouldPassIssue(test.issue) + //nolint:testifylint // It's a loop and the main expectation is the error message. assert.EqualError(t, err, test.expected) assert.False(t, pass) }) diff --git a/pkg/result/processors/skip_files_test.go b/pkg/result/processors/skip_files_test.go index fbea9bb34da1..3a1129eff046 100644 --- a/pkg/result/processors/skip_files_test.go +++ b/pkg/result/processors/skip_files_test.go @@ -49,6 +49,6 @@ func TestSkipFiles(t *testing.T) { func TestSkipFilesInvalidPattern(t *testing.T) { p, err := NewSkipFiles([]string{"\\o"}, "") - assert.Error(t, err) + require.Error(t, err) assert.Nil(t, p) }