Antonboom / testifylint

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

Consider adding optional revive linters #158

Open ccoVeille opened 5 days ago

ccoVeille commented 5 days ago

I noticed than many of the code review I'm doing are about code simplification are about early-return pattern.

I recommend using revive that could detect this pattern. early-return is one we need I think

We may review a few more linters in the process but it would definitely help I think

_Originally posted by @ccoVeille in https://github.com/Antonboom/testifylint/pull/155#discussion_r1654060753_

mmorel-35 commented 4 days ago

Just something to be aware of when you'll customize revive config in golangci lint config file. As it it is today, the default configuration of revive is used by default. But once you'll want to specify the activation of a rule, you'll need to add explicitly every other rules you want to be activated including the list of the defaults, otherwise you'll have only one active rule.

Please read last paragraph of this section https://github.com/mgechev/revive?tab=readme-ov-file#golangci-lint on revive's GitHub page

ccoVeille commented 4 days ago

I know, it's a pain. That's why I started working on a personal project to document such things and provide ready to go golangci-lint configuration files

https://github.com/ccoVeille/golangci-lint-config-examples

I will populate it in the next days