Single Quoted String Containing Variables


Single quoted strings do not get interpolated, so you should not attempt to embed variables in one. This is not a style issue, rather a common mistake.

What you have done

  $foo = 'bar ${baz}'

What you should have done:

  $foo = "bar ${baz}"

Disabling the check

To disable this check you can add --no-single_quote_string_with_variables-check to your puppet-lint command line.

$ puppet-lint --no-single_quote_string_with_variables-check path/to/file.pp

Alternatively, if you’re calling puppet-lint via the Rake task, you should insert the following line to your Rakefile.

PuppetLint.configuration.send('disable_single_quote_string_with_variables')