Skip to content

Commit

Permalink
[chore]: enable suite-dont-use-pkg rule from testifylint (#35041)
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
[suite-dont-use-pkg](https://github.com/Antonboom/testifylint?tab=readme-ov-file#suite-dont-use-pkg)
rule from [testifylint](https://github.com/Antonboom/testifylint)

Signed-off-by: Matthieu MOREL <[email protected]>
  • Loading branch information
mmorel-35 authored Sep 12, 2024
1 parent 0e691f5 commit 8d7e04d
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 5 deletions.
1 change: 0 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@ linters-settings:
- formatter
- go-require
- require-error
- suite-dont-use-pkg
- suite-subtest-run
- useless-assert
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 @@ -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,formatter,go-require,require-error,suite-dont-use-pkg,suite-subtest-run,useless-assert
TESTIFYLINT_OPT?= --enable-all --disable=float-compare,formatter,go-require,require-error,suite-subtest-run,useless-assert

# BUILD_TYPE should be one of (dev, release).
BUILD_TYPE?=release
Expand Down
4 changes: 2 additions & 2 deletions receiver/jmxreceiver/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@ func (suite *JMXIntegrationSuite) SetupSuite() {
for version, url := range jmxJarReleases {
jarPath, err := downloadJMXMetricGathererJAR(url)
suite.VersionToJar[version] = jarPath
require.NoError(suite.T(), err)
suite.Require().NoError(err)
}
}

func (suite *JMXIntegrationSuite) TearDownSuite() {
for _, path := range suite.VersionToJar {
require.NoError(suite.T(), os.Remove(path))
suite.Require().NoError(os.Remove(path))
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func (suite *SubprocessIntegrationSuite) SetupSuite() {
}

func (suite *SubprocessIntegrationSuite) TearDownSuite() {
require.NoError(suite.T(), os.Remove(suite.scriptPath))
suite.Require().NoError(os.Remove(suite.scriptPath))
}

// prepareSubprocess will create a Subprocess based on a temporary script.
Expand Down

0 comments on commit 8d7e04d

Please sign in to comment.