bake
bake copied to clipboard
RFC: Change Fixture and Tests to opt-in
I always have to append the --no-test
and --no-fixture
to my bake commands, to prevent the generation of these additional files.
I would propose that the no-test and no-fixture become defaults, and that --with-test
and --with-fixture
are added to invert the logic.
I can see a few advantages of this.
- The shell does not create files which the user is not expecting
- Quite often, I guess, most people add tests as a specific activity, rather than when they make the model
- The additional files clutter up Git repos, as the tests folder is rightly not ignored
- Less files being written and processed should make basic baking quicker
I think it should be kept this way. But: One could follow my earlier tip and approach ( https://github.com/cakephp/bake/pull/365/files ) to make the configs Configure defaultable. As such everyone can have his own defaults just fine.
I do that will a lot of my shells and tooling. Always $config + (array)Configure::read('Bake') etc.
So perhaps just an update to Bakes documentation then?
No, I only applied my configure approach to one specific flag. I recommended to do that for all.
Anyone interested in a PR that would allow setting more global personal defaults? That would solve this per person/preference. The default of having the tests and fixtures right away still sounds like the right thing - to enable more test driven development from the start. But opting out of it using config is a fair thing for those that chose to take that path.
I can't think of a clean way to do this generically. Users can customize the command to overwrite the options.