Skip to content

v0.16.0

Latest
Compare
Choose a tag to compare
@github-actions github-actions released this 10 Feb 16:02
928ce33

Fixing yaml library stuff

This release features fixes for a couple problems in the yaml library, and one new feature.

Features

Alternate Array Indentation

There is now support for array_indent, indenting arrays at a different level than anything else, and indent_root_array, an option to indent an array that is at the root of the document.
To tell you the truth, I couldn't have possibly imagined anyone wanting this. It's quite outlandish to me. I decided to implement it because the request was well specified (#237), it was very simple to implement, and it could be implemented in a completely unintrusive and opt-in way, without me needing to worry whether other parsing might break as a result. Given that, I figured adding new options couldn't hurt!

Bug Fixes

Nested Indentless Arrays

There was an edge case where nested arrays would get collapsed when doing indentless arrays. This has been fixed now and should function as expected.

Comment Rendering Above Document Start

Comments above a document start used to end up rendered below the document start token with an extra newline. After digging into it I found out that this was a deliberate choice made by the upstream library (i.e. it was not in libyaml which that library was ported from) and I consider it an odd choice. I've changed it to work how one would expect, with comments above document start being rendered above the --- token.
I decided to make the change directly without guarding it with an option, since I thought the default behaviour was so odd and I can't imagine a world where someone wants it that way. But yaml is stupid, you never know if there's a random edge case I couldn't fathom that was broken by this. Hoping it will be okay, but might need a patch release if there's something I missed.

Contributors

  • Thanks @abicky for fixing the nested indentless array bug
  • Thanks @ELLIOTTCABLE for the original feature request for array indentation and contributing to the development of it