gruntwork-io / boilerplate

A tool for generating files and folders ("boilerplate") from a set of templates
https://www.gruntwork.io
Mozilla Public License 2.0
157 stars 12 forks source link

[PROPOSAL] Consider deprecating and removing --missing-key-action #93

Open yorinasub17 opened 2 years ago

yorinasub17 commented 2 years ago

--missing-key-action is only relevant for the use case where you:

I think this is very hard to use in practice, and encourages poor boilerplate templates, where you by design use variables that have no explicitly passed in values, or defaults defined in the boilerplate.yml config.

I think this is an anti-pattern, and we should make boilerplate always encourage and enforce that a referenced variable shows up in at least one of the following:

This is the equivalent of setting --missing-key-action=error, which is the default.

I don't see a valid use case for the other actions in boilerplate land, as I believe all other use cases can be handled by defining the variable explicitly (e.g., if you want --missing-key-action zero, you set the variable to the expected zero value in CLI with --var or in a var file).