On Saturday, August 15, 2015 at 9:12:53 PM UTC-5, Rich Burroughs wrote:
Hi David,
My guess is that this is because of the guideline in section 9.1 that all resource titles be quoted. So that is the area where it should be done for consistency. Otherwise if you have a standalone variable elsewhere in your manifest, it's not necessary to quote it.
Generally the impetus behind the suggestions in the style guide is to make the code as readable as possible. That partly means being consistent (like quoting all titles), and keeping things as simple as possible (not quoting standalone variables, and using single quotes for strings unless there is a variable being interpolated, etc.).
I'm pretty sure I've written code where there were unquoted variables in titles and it worked fine (in Puppet 3.x anyway). You aren't required to use all of the formatting in the style guide, and if you're using puppet-lint you can disable specific checks you don't want to use.
Yes, quoting resource titles is a convention, not a requirement. In fact, when you use an array title, whether a literal array or a variable whose value is an array, you
must not quote it.
As a convention and style matter I absolutely favor quoting scalar resource titles that consist at least partly of literal text, but titles that consist entirely of a variable reference are a gray area. The quotes provide little clarity benefit, and no consistency benefit (since there are cases where quotes must not be used). I think a safer interpretation of the conventions is that titles consisting solely of a variable reference
may be quoted, not that they
should be quoted. If puppet-lint disagrees then I think I'd account that a bug.
John