sqlfmt icon indicating copy to clipboard operation
sqlfmt copied to clipboard

Standardize blank lines to no more than 1

Open tconbeer opened this issue 3 years ago • 0 comments

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

tconbeer avatar Aug 21 '22 18:08 tconbeer