Antonboom / testifylint

The Golang linter that checks usage of github.com/stretchr/testify.
https://github.com/stretchr/testify
MIT License
87 stars 8 forks source link

suite-naming: enforce consistent suite naming #48

Open Limero opened 6 months ago

Limero commented 6 months ago

Running testifylint on a large codebase at work I noticed that suits are not consistently named. It would be useful if testifylint detected this and enforced usage of either (suite *TestSuite) or (s *TestSuite).

Example of inconsistent naming:

// example1_test.go
type ExampleTestSuite1 struct {
    suite.Suite
}

func (suite *ExampleTestSuite1) TestExample() {
}

// example2_test.go
type ExampleTestSuite2 struct {
    suite.Suite
}

func (s *ExampleTestSuite2) TestExample() {
}
Antonboom commented 6 months ago

Hi!

Thank you for feedback. Related to https://github.com/Antonboom/testifylint/blob/master/CONTRIBUTING.md#suite-test-name

Antonboom commented 1 month ago

Also related https://github.com/stretchr/testify/pull/1512