linter icon indicating copy to clipboard operation
linter copied to clipboard

Add a lint for classes named "Mock" something that don't have a noSuchMethod

Open natebosch opened this issue 7 years ago • 1 comments

It's very unlikely that a class without a noSuchMethod is a Mock. It is much more likely to be a stub or a fake. If we can trust that these terms are used precisely it's easier to read test code, but it's a very prevalent mistake to name a stub or fake as MockSomething. We could look for a good reference explaining the difference in these terms and point the lint at it since it's a good way to spread knowledge.

natebosch avatar Oct 23 '18 22:10 natebosch

I support this. To me this is mostly a style question, but in large enough code bases consistency is important to me.

matanlurey avatar Oct 23 '18 23:10 matanlurey