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

WIP: Allow certain, simple Jinja values to be unquoted. #36331

Open
wants to merge 3 commits into
base: devel
Choose a base branch
from

Commits on Feb 16, 2018

  1. Allow certain, simple jinja values to be unquoted.

    This allows the following to be unquoted:
    ```
    foo: {{ bar }}
    ```
    
    The above is valid YAML but semantically means something like this:
    ```
    { "foo": { { "bar": null}: null} }
    ```
    
    This patch looks for events of that form coming from the parser, and
    reconstructs the key `bar` into a string node of value "{{ bar }}".
    ingydotnet committed Feb 16, 2018
    Copy the full SHA
    f35d202 View commit details
    Browse the repository at this point in the history
  2. Handle unquoted Jinja string values properly

    This works properly now:
    ```
    unquoted: {{ foo }}
    quoted: {{ 'foo' }}
    ```
    ingydotnet committed Feb 16, 2018
    Copy the full SHA
    1761a18 View commit details
    Browse the repository at this point in the history

Commits on Feb 17, 2018

  1. Don't allow {{ 'foo' }} unquoted jinja value

    The unquoted jinja feature only works when the unquoted value is valid
    YAML.
    
    Don't allow `foo: {{ 'bar' }}` when the internal value is a quoted
    string. This form is dubious and probably never seen in the wild. We
    just don't give it special treatment so it fails same as before.
    
    Also added check to assert jinja key is a string.
    ingydotnet committed Feb 17, 2018
    Copy the full SHA
    c87af62 View commit details
    Browse the repository at this point in the history