tmt icon indicating copy to clipboard operation
tmt copied to clipboard

Change the default formatting of YAML emitted by tmt

Open happz opened this issue 3 months ago • 1 comments

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 setting 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 https://github.com/teemtee/tmt/issues/3432

Pull Request Checklist

  • [ ] implement the feature
  • [ ] write the documentation
  • [ ] extend the test coverage
  • [ ] update the specification
  • [ ] adjust plugin docstring
  • [ ] modify the json schema
  • [ ] mention the version
  • [ ] include a release note

happz avatar Nov 18 '25 12:11 happz

Blocked by https://github.com/teemtee/tmt/pull/4334

happz avatar Nov 19 '25 10:11 happz