Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Syntax error when using Unicode characters in heredoc #946

Open
Martin8412 opened this issue May 27, 2021 · 0 comments
Open

Syntax error when using Unicode characters in heredoc #946

Martin8412 opened this issue May 27, 2021 · 0 comments

Comments

@Martin8412
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant