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
158 stars 12 forks source link

Support marshaling boilerplate config to yaml #74

Closed yorinasub17 closed 3 years ago

yorinasub17 commented 3 years ago

This adds marshaling functions to all the boilerplate config structs.

Use case: This is useful to machine generate boilerplate configuration files, which is something we plan on doing in the refarch-deployer CLI.

yorinasub17 commented 3 years ago

How is this used? Do the docs need to be updated?

I don't think the docs need to be updated. This just makes it so that if you use boilerplate as a library and construct the BoilerplateConfig struct, you can call yaml.Marshal on it, making it a two way yaml struct. It was a bit unexpected that it didn't already support marshaling (since it supported unmarshaling), so arguably this is a "bugfix".

yorinasub17 commented 3 years ago

Thanks for review! Going to merge this in as I need this in the current feature I am writing. We can revisit clarifying docs in a future PR if there is objection to my comment above.

brikis98 commented 3 years ago

How is this used? Do the docs need to be updated?

I don't think the docs need to be updated. This just makes it so that if you use boilerplate as a library and construct the BoilerplateConfig struct, you can call yaml.Marshal on it, making it a two way yaml struct. It was a bit unexpected that it didn't already support marshaling (since it supported unmarshaling), so arguably this is a "bugfix".

Roger!