puppet-lint
puppet-lint copied to clipboard
Syntax error when using Unicode characters in heredoc
After upgrading from puppet-lint from 2.3.6 to 2.4.0 we've started experiencing issues with Unicode characters in non-interpolated heredoc blocks of text. This also happens in 2.4.2.
To reproduce the issue, here is a simplified example that will cause a syntax error
define foo {
$content1 = @(EOT)
😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀
| EOT
$content2 = @(EOT)
🙂🙂🙂🙂🙂🙂🙂🙂🙂🙂🙂🙂🙂🙂🙂🙂🙂🙂🙂🙂🙂🙂🙂🙂🙂🙂🙂🙂🙂🙂🙂🙂🙂🙂🙂🙂🙂
| EOT
$content3 = @(EOT)
┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬
| EOT
}
Here is the result of linting it
$ puppet-lint --fail-on-warnings --no-documentation-check --no-autoloader_layout-check --no-parameter_order-check --no-140chars-check --no-unquoted_node_name-check test.pp
ERROR: Syntax error on line 4
Try running `puppet parser validate <file>`
If we use single quotes instead of a heredoc it doesn't cause a syntax error.