Skip to content
Advertisement

Tag: ruamel.yaml

Is there a way to apply transformations on dump() with ruamel.yaml?

Context I am using ruamel.yaml (0.17.21) to automatically inject/update nested objects to a collection of existing YAML documents. All these documents have a maximum line length of 120 characters, enforced by a linter. I was expecting to be able to retain this formatting rule by setting the width attribute on the YAML instance. However, in practice, unbreakable words such as

Advertisement