sqlfmt
sqlfmt copied to clipboard
Standardize blank lines to no more than 1
The opinion of some formatters for other languages
- https://prettier.io/docs/en/rationale.html#empty-lines
- https://black.readthedocs.io/en/stable/the_black_code_style/current_style.html#empty-lines
Both leave empty lines from original format, but collapse them to a standard number of lines (ie. 0 empty lines remain 0, 7 or 6 or 1 empty lines all become eg 1 empty line)
Black goes even further and adds empty lines in some places (which I think you could consider doing eg around CTEs for readability)
Originally posted by @nfcampos in https://github.com/tconbeer/sqlfmt/discussions/230#discussioncomment-3311683