-
Notifications
You must be signed in to change notification settings - Fork 17
Open
Description
Description
We can give a width so that a line will be wrapped automatically:
ruamel= yaml.YAML()
ruamel.width = 80
The issue is that this will trigger the line-wrap after it overflows. For example, suppose we define the width to 80 and have the following to dump:
mylist: [ onequitelongitem, secondquitelongitem, thirdmuchlongeritem, thelongestelementofthelistthatoverflows ]
Proposal
The library will dump it this way because just after thirdmuchlongeritem
we only have about 70 characters, therefore we add the last element on the same line. The library should give an option to wrap the line before the overflow happens.
The previous example would result into this instead:
mylist: [ onequitelongitem, secondquitelongitem, thirdmuchlongeritem,
thelongestelementofthelistthatoverflows ]
Metadata
Metadata
Assignees
Labels
No labels