Skip to content

Allow options injection for to_yaml #1137

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

Merged
merged 1 commit into from
Nov 16, 2020

Conversation

baurmatt
Copy link
Contributor

This makes it possible to inject formatting options into the to_yaml function.

@baurmatt baurmatt requested a review from a team as a code owner November 12, 2020 11:27
@puppet-community-rangefinder
Copy link

to_yaml is a function

Breaking changes to this file MAY impact these 30 modules (near match):

This module is declared in 319 of 575 indexed public Puppetfiles.


These results were generated with Rangefinder, a tool that helps predict the downstream impact of breaking changes to elements used in Puppet modules. You can run this on the command line to get a full report.

Exact matches are those that we can positively identify via namespace and the declaring modules' metadata. Non-namespaced items, such as Puppet 3.x functions, will always be reported as near matches only.

This makes it possible to inject formatting options into the to_yaml
function.
@codecov-io
Copy link

codecov-io commented Nov 12, 2020

Codecov Report

Merging #1137 (fcd0099) into main (7c1ae25) will increase coverage by 0.29%.
The diff coverage is 0.00%.

Impacted file tree graph

@@           Coverage Diff            @@
##            main   #1137      +/-   ##
========================================
+ Coverage   5.31%   5.60%   +0.29%     
========================================
  Files        185     186       +1     
  Lines       5273    5230      -43     
========================================
+ Hits         280     293      +13     
+ Misses      4993    4937      -56     
Impacted Files Coverage Δ
lib/puppet/functions/to_yaml.rb 0.00% <0.00%> (ø)
lib/facter/facter_dot_d.rb 19.19% <0.00%> (-19.81%) ⬇️
lib/puppet/functions/parsehocon.rb 0.00% <0.00%> (ø)
lib/facter/root_home.rb 69.23% <0.00%> (+3.84%) ⬆️
lib/puppet/parser/functions/dig44.rb 53.33% <0.00%> (+53.33%) ⬆️
lib/puppet/parser/functions/has_interface_with.rb 92.30% <0.00%> (+92.30%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7c1ae25...fcd0099. Read the comment docs.

@adrianiurca
Copy link
Contributor

Thanks, @baurmatt for your contribution!

kind regards,
@adrianiurca

@adrianiurca adrianiurca merged commit 5abecf1 into puppetlabs:main Nov 16, 2020
# @example Use options control the output format
# file { '/tmp/my.yaml':
# ensure => file,
# content => to_yaml($myhash, {indentation: 4})
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

{indentation: 4} doesn't look like a valid puppet hash to me. Or am I missing something?

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

Successfully merging this pull request may close these issues.

4 participants