Skip to content

Commit

Permalink
[chore]: enable formatter rule from testifylint (#11173)
Browse files Browse the repository at this point in the history
#### Description

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

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

Signed-off-by: Matthieu MOREL <[email protected]>
  • Loading branch information
mmorel-35 authored Sep 17, 2024
1 parent 30b4ed0 commit 64954f4
Show file tree
Hide file tree
Showing 3 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 @@ -125,7 +125,6 @@ linters-settings:
# TODO: enable all rules
disable:
- float-compare
- formatter
- go-require
- require-error
enable-all: true
Expand Down
2 changes: 1 addition & 1 deletion Makefile.Common
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ SEMCONVGEN := $(TOOLS_BIN_DIR)/semconvgen
SEMCONVKIT := $(TOOLS_BIN_DIR)/semconvkit
TESTIFYLINT := $(TOOLS_BIN_DIR)/testifylint

TESTIFYLINT_OPT?= --enable-all --disable=float-compare,formatter,go-require,require-error
TESTIFYLINT_OPT?= --enable-all --disable=float-compare,go-require,require-error

.PHONY: install-tools
install-tools: $(TOOLS_BIN_NAMES)
Expand Down
5 changes: 2 additions & 3 deletions cmd/mdatagen/internal/validate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
package internal

import (
"fmt"
"io/fs"
"path/filepath"
"testing"
Expand Down Expand Up @@ -132,10 +131,10 @@ func TestValidateMetricDuplicates(t *testing.T) {
for _, metricName := range metrics {
if val, exists := seen[metricName]; exists {
receivers, allowed := allowedMetrics[metricName]
assert.True(
assert.Truef(
t,
allowed && contains(receiver, receivers) && contains(val, receivers),
fmt.Sprintf("Duplicate metric %v in receivers %v and %v. Please validate that this is intentional by adding the metric name and receiver types in the allowedMetrics map in this test\n", metricName, receiver, val),
"Duplicate metric %v in receivers %v and %v. Please validate that this is intentional by adding the metric name and receiver types in the allowedMetrics map in this test\n", metricName, receiver, val,
)
}
seen[metricName] = receiver
Expand Down

0 comments on commit 64954f4

Please sign in to comment.