Skip to content

Yaml Dumper removes blank lines seemingly arbitrarily

Summary

While working on the bst fmt command, I've run across a weird issue with the yaml dumping. It seems that dumping the yaml will sometimes remove all blank lines in a file, but not every time. It seems reliably reproducible by running bst fmt 3 times on a single file in this branch

Steps to reproduce

Either use bst fmt as in the branch above 3 times on a single element, or run bst track a few times on a single element, discarding the changes to the ref each time.

Running three times seems to get the behaviour to happen reliably, but sometimes the blank lines are removed after less runs than this.

What is the current bug behavior?

Blank lines occasionally removed from files when yaml dumped.

What is the expected correct behavior?

Blank lines should be left as they are.

Possible fixes

I suspect this is a bug in ruamel.yaml.


Edited by Javier Jardón
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information