mockolo icon indicating copy to clipboard operation
mockolo copied to clipboard

Skip creation of empty files if there are no mocks to generate

Open azatZul opened this issue 5 months ago • 2 comments

What did you do?

Run mockolo -s <SOURCE> -d <DESTINATION> on the source folder which doesn't have protocols with mockable annotation. It generated a file without any mocks.

What did you expect to happen?

I'd expect the empty file won't be created. Or at least having a flag which allows to skip creation of those empty files. I recognise that the tools also will need to remove the destination file in that case which adds some complications but still, arguable it's worth it.

What is the use-case

If in a modularised project the script is executed once per module, modules which not yet added mock annotation will end up having empty files which is not ideal.

Mockolo Environment

Mockolo Version: 2.0.1 Dependency Manager: Homebrew Xcode Version: 15.0

azatZul avatar Jan 08 '24 17:01 azatZul