New empty assets would have a literal "{}" as their content (and diffs would also include the "{}").
This removes the spurious {}.
My first approach was to pass None or '' to yaml.dump(), but both serialized to non-empty strings. So the only option is to explicitly return what an empty file should be.
I was unsure where to put the tests, but I settled on edit partly by choice and partly by accident. This bug was already inadvertently documented in those tests. And I do think that editing with printf is a relatively easy and intuitive place to verify that the content is precisely what we expect.
New empty assets would have a literal "{}" as their content (and diffs would also include the "{}").
This removes the spurious
{}
.My first approach was to pass
None
or''
toyaml.dump()
, but both serialized to non-empty strings. So the only option is to explicitly return what an empty file should be.I was unsure where to put the tests, but I settled on
edit
partly by choice and partly by accident. This bug was already inadvertently documented in those tests. And I do think that editing withprintf
is a relatively easy and intuitive place to verify that the content is precisely what we expect.close #663