This uses the maximum line length to set the output width for the yaml dump in ybump and yupdate. This avoids having to set a ridiculously large width parameter (there is no way to have it accept arbitrary widths).
Without this the scripts mess up formatting for e.g. very long descriptions (or any other line/value longer than 200 characters), which then leads to errors during the package build or other operations.
One could also parse each element of the yaml to find the largest one, but I couldn't quite figure that one out without it getting a bit too complicated
Disadvantage here is that it read the input file twice (once to get the "raw" lines, ones to parse it into a yaml dict). It still happens in the blink of an eye, but it's of course not ideal.
This uses the maximum line length to set the output width for the yaml dump in
ybump
andyupdate
. This avoids having to set a ridiculously largewidth
parameter (there is no way to have it accept arbitrary widths). Without this the scripts mess up formatting for e.g. very long descriptions (or any other line/value longer than 200 characters), which then leads to errors during the package build or other operations.One could also parse each element of the yaml to find the largest one, but I couldn't quite figure that one out without it getting a bit too complicated
Disadvantage here is that it read the input file twice (once to get the "raw" lines, ones to parse it into a yaml dict). It still happens in the blink of an eye, but it's of course not ideal.
Example akonadi:
ybump result before:
ybump result after: