Antonboom / testifylint

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

bool-compare: compares: add Empty And Zero #106

Closed ccoVeille closed 5 months ago

ccoVeille commented 5 months ago

Some people may use testify Zero, Empty, NotZero, and NotEmpty asserters the same way True or False could have been used

ccoVeille commented 5 months ago

I thought about it after we closed https://github.com/Antonboom/testifylint/issues/75

Zero and Empty are like True and False, they can be used wrongly

This one is somehow related to #105 as it's about adding zero and empty to existing asserter.

I preferred a dedicated issue as they could be reviewed separately

Antonboom commented 5 months ago

@ccoVeille, I did not catch what patterns are you talking about?

Can you share specific examples and links to search, thanks

ccoVeille commented 5 months ago

My idea was to extend existing checker with strange case people may use as empty/zero could be used the same way that True/False are used in bool compare.

I checked at existing piece of code by using GitHub search and I found nothing relevant.

You seem not likely open to catch this. OK then.