Change the default formatting of YAML emitted by tmt#4338
Merged
Conversation
Contributor
Author
|
Blocked by #4334 |
6d5a39d to
0f1f547
Compare
ee1cd5c to
0e90113
Compare
0e90113 to
337d62d
Compare
337d62d to
5fa60ad
Compare
5fa60ad to
917714d
Compare
e1cc042 to
76e10d1
Compare
psss
reviewed
Apr 8, 2026
Member
psss
left a comment
There was a problem hiding this comment.
I'm not able to reproduce the original issue.
2 tasks
LecrisUT
approved these changes
Apr 9, 2026
Member
LecrisUT
left a comment
There was a problem hiding this comment.
👍 for me, it is at least consistent with #4712. I just realized that
The C based emitter doesn’t have the fine control, distinguishing between block mappings and sequences. Do only use the pure Python versions of the dumper if you want to have that sort of control.
🙃
therazix
approved these changes
Apr 13, 2026
psss
approved these changes
Apr 13, 2026
By setting `mapping`, `sequence`, and `offset` formatting hints for the YAML dumper, the produced YAML incorrectly handles multiline strings starting with an empty line, and export of collection items under `tmt * export`. After some experimenting, there seem to be no silver bullet ticking all boxes WRT YAML formatting, but resorting to setting just `sequence=2` seems to produce a reasonably formatted YAML. Note that this does not affect YAML - or fmf - accepted by tmt, only YAML/fmf files written by tmt. Fixes #3432
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
By setting
mapping,sequence, andoffsetformatting hints for the YAML dumper, the produced YAML incorrectly handles multiline strings starting with an empty line, and export of collection items undertmt * export.After some experimenting, there seem to be no silver bullet ticking all boxes WRT YAML formatting, but resorting to setting just
sequence=2seems to produce a reasonably formatted YAML.Note that this does not affect YAML - or fmf - accepted by tmt, only YAML/fmf files written by tmt.
Fixes #3432
Pull Request Checklist