Skip to content

YAML parsing error for valid plain scalar #46

@KaffeMyers

Description

@KaffeMyers

Title

qq rejects valid YAML plain scalar but accepts block scalar equivalent

Description

qq -i yaml fails to parse a YAML file that is accepted by yq, even though the two inputs are semantically identical. The failure occurs when a list item is expressed as a multiline plain scalar; rewriting it as a block scalar works.

Reproduction

Failing input

key:
  - dummy_args=(
      --null-input
    )
qq -i yaml aoeu.yaml
error parsing input: [4:5] value is not allowed in this context

Same input accepted by yq

yq . aoeu.yaml
{
  "key": [
    "dummy_args=( --null-input )"
  ]
}

Working variant

Equivalent value expressed as a block scalar:

key:
  - |
    dummy_args=(
      --null-input
    )

This parses correctly with both qq and yq.

Expected behavior

The original YAML should be accepted, as it is valid and parsed successfully by yq.

Actual behavior

qq rejects the plain-scalar form with a syntax error.

Environment

  • OS: Debian Trixie Linux
  • qq: v0.3.4 (but the --version output reports v0.3.3)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions