erikdoe / ocmock

Mock objects for Objective-C
http://ocmock.org
Apache License 2.0
2.16k stars 606 forks source link

Have some warnings/errors for bad library usage #413

Open dmaclach opened 4 years ago

dmaclach commented 4 years ago

This isn't really an issue as opposed to a meta feature request.

We use OCMock in a large codebase with hundreds of projects. OCMock as a library is very easy to use "incorrectly", especially after code has been refactored a few times. There are a few places in ocmock where I would like to be able to have a "warning" that could be also an "error". Examples:

What I would want to be able to do is to have these as logging warnings until I could get them fixed on a project by project basis, and then turn them into throwing errors to prevent backsliding in the future. I was thinking of having it controllable by an environment variable as well as a global BOOL flag.

Thoughts?

dmaclach commented 4 years ago

See #414 as an example

matrush commented 4 years ago

Yeah. I have had to manually fix hundreds of files (if not thousands) manually in my previous version bump to 3.5. (I did it 😂) With a large codebase it's really annoying :)