rodjek / puppet-lint

Check that your Puppet manifests conform to the style guide
MIT License
820 stars 204 forks source link

double_quoted_strings does not permit space escape sequence #952

Closed optiz0r closed 3 years ago

optiz0r commented 3 years ago

The following code triggers the double_quoted_strings warning, but should not. The \s escape sequence is only valid within double-quoted strings, not in single quoted strings, so the type of quotes cannot be changed, and the string may legitimately not contain any variables.

Example false positive:

split(strip($foo),"\s")

https://github.com/rodjek/puppet-lint/blob/master/lib/puppet-lint/plugins/check_strings/double_quoted_strings.rb#L7 should include \\s as an additional case for a valid string to not fail the check.

optiz0r commented 3 years ago

Re-raised here: https://github.com/puppetlabs/puppet-lint/issues/16