google / yamlfmt

An extensible command line tool or library to format yaml files.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Preserve at most X lines setting

jgspratt opened this issue · comments

I would like to be able to preserve two blank lines (any more than two blank lines should be reduced to two blank lines).

I suggest the following backwards compatible change:

  • retain_line_breaks (bool) - Retains all line breaks
  • retain_line_breaks_single (bool) - Retains at most one line break (takes precedence over retain_line_breaks)
  • retain_line_breaks_count (int) - Retains at most this many line breaks (takes precedence over retain_line_breaks and retain_line_breaks_single)