Uploaded image for project: 'Puppet'
  1. Puppet
  2. PUP-4514

Improve external syntax checking of heredoc

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Accepted
    • Priority: Normal
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: PUP 5.y
    • Component/s: None
    • Labels:
      None
    • Template:
    • Epic Link:
    • Team:
      Coremunity

      Description

      Currently, the external syntax checkers are only checked after evaluation of the heredoc expression because a heredoc may include interpolations.
      It should be possible to check the syntax of a heredoc that has static content at validation time (and then skip this check at evaluation time).

      In order to achieve this the external_syntax_support must be modified since it now requires scope to get to the compiler to get the injector to get the bound syntax checkers. (This should be refactored for other reasons as well).

      The benefit of doing static validation of a heredoc is that static Json, Yaml, etc. or indeed inline EPP can be validated e.g. by writing:

      inline_epp(@(END:epp))
        Hello <%= $name %>
      END
      

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            henrik.lindberg Henrik Lindberg
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:

                Zendesk Support