From a5fd611237b9fcd0a705a6e03bf6b5cdaae4e3ba Mon Sep 17 00:00:00 2001 From: Josh Cooper Date: Mon, 22 Jul 2024 15:37:55 -0700 Subject: [PATCH] Workaround strings bug when generating function docs Added a newline between the require statement and start of documentation to work around https://github.com/puppetlabs/puppet-strings/issues/296 To verify, run: echo 'gem "puppet-strings"' >> Gemfile.local bundle update bundle exec puppet strings generate --format json --out /tmp/strings.json jq -r '.puppet_functions[] | select(.name == "yaml_data").docstring.text ' /tmp/strings.json | head (cherry picked from commit dd4d8b811ad3aa4d963f1b3d4529c13df9034542) --- lib/puppet/functions/hiera.rb | 1 + lib/puppet/functions/yaml_data.rb | 1 + 2 files changed, 2 insertions(+) diff --git a/lib/puppet/functions/hiera.rb b/lib/puppet/functions/hiera.rb index cf70880a578..16e61c4e210 100644 --- a/lib/puppet/functions/hiera.rb +++ b/lib/puppet/functions/hiera.rb @@ -1,4 +1,5 @@ require 'hiera/puppet_function' + # Performs a standard priority lookup of the hierarchy and returns the most specific value # for a given key. The returned value can be any type of data. # diff --git a/lib/puppet/functions/yaml_data.rb b/lib/puppet/functions/yaml_data.rb index 3dbcc598b71..e37a62b0ec2 100644 --- a/lib/puppet/functions/yaml_data.rb +++ b/lib/puppet/functions/yaml_data.rb @@ -1,5 +1,6 @@ require 'yaml' + # The `yaml_data` is a hiera 5 `data_hash` data provider function. # See [the configuration guide documentation](https://puppet.com/docs/puppet/latest/hiera_config_yaml_5.html#configuring-a-hierarchy-level-built-in-backends) for # how to use this function.