Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
azatZul opened this issue Jan 8, 2024 · 2 comments
Open

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

azatZul opened this issue Jan 8, 2024 · 2 comments

Comments

@azatZul
Copy link

azatZul commented Jan 8, 2024

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

@sidepelican
Copy link
Collaborator

An empty file implies an empty output.
Is there a problem, or is it just a matter of feelings?

@sidepelican
Copy link
Collaborator

I want to ensure that first-time users are not confused if no file is generated.
If it's a matter of feelings, I'm curious to know if there are others who agree.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants