yaml / yaml-test-suite

Comprehensive, language independent Test Suite for YAML
MIT License
172 stars 58 forks source link

Open ended streams need document end marker #49

Closed perlpunk closed 4 years ago

perlpunk commented 4 years ago

...like block scalars with the |+ indicator for keeping trailing empty lines

This document, if the last in the stream:

keep: |+
  line1

should be emitted as:

keep: |+
  line1

...

pyyaml and ruamel are doing this correctly (libyaml will do after the next release)

But there's room for discussion: Arguably, this rule should also apply to all other documents in the stream, because a single document in a stream should be the same as the document alone.

But neither pyyaml nor ruamel currently output a ... in this case:

keep: |+
  line1

--- doc two

I suggest to fix those two cases for now and discuss about the other use case then.

perlpunk commented 4 years ago

See #50 for a followup