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

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

Open
yorinasub17 opened this issue Feb 28, 2022 · 0 comments
Open
Labels
enhancement New feature or request maintainer only We need a Grunt to take the lead on this issue

Comments

@yorinasub17
Copy link
Contributor

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

  • Reference a variable that does not have an explicit configuration in boilerplate.yml.
  • That variable does not have a value passed in via --var or --var-file.
  • You want to silently render that because you can't tolerate errors.

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:

  • The boilerplate.yml config
  • An explicitly set variable in --var
  • An explicitly set variable in --var-file

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).

@yorinasub17 yorinasub17 added enhancement New feature or request maintainer only We need a Grunt to take the lead on this issue labels Feb 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request maintainer only We need a Grunt to take the lead on this issue
Projects
None yet
Development

No branches or pull requests

1 participant