-
Notifications
You must be signed in to change notification settings - Fork 143
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
YAML export indents multiline strings with block indentation indicator way too much #3432
Comments
The problem seems to be in the YAML export.
|
Seems like a problem between tmt and ruamel.yaml emitter. Emitter collects hints, indentation and indicator for a given literal (string), which is The problem is gone when I disable indentation enforced by tmt, $ /home/happz/.local/share/hatch/env/virtual/tmt/BuhwJjvK/dev/bin/tmt plan export /plans/example
- name: /plans/example
summary: |2
Basic smoke test
Next line to interpret
description:
contact: []
enabled: true
order: 50
link: []
id:
tag: []
tier:
context: {}
gate: []
login:
sources:
- /tmp/foo/plans/example.fmf
discover:
- name: default-0
how: shell
provision:
- name: default-0
how: virtual
prepare:
- name: default-0
how: shell
execute:
- how: tmt
script: tmt --help
name: default-0
report:
- name: default-0
how: display
finish:
- name: default-0
how: shell Adding - name: /plans/example
summary: |2
Basic smoke test
Next line to interpret
description:
... Basically, I was unable to find a combination of The indentation setting affects how tmt writes its YAML files, which are either its state files, or the export like this, but also fmf files, e.g. by |
tmt plan export does not interpret spaces scalar if attribute content starts with new line
How to reproduce
tmt init --template mini
tmt plan export /plans/example | yq '.[0].summary'
Expected
Actual
Note: If there is no new line between "summary: |2"
and "Basic smoke test" - then export behaves as expected
Use case: if I need to pass a kickstart script where I use a file defined by heredoc (the script would not be able to catch the second EOF)
The text was updated successfully, but these errors were encountered: