Suggestion: Don't allow more than 1 consecutive blank line #230
-
Describe the bug To Reproduce
Expected behavior
Actual behavior
Additional context |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Right now we try to leave all blank lines as-is, unless we merge across them. There is a bug I introduced somewhere between 0.8 and 0.10 that eliminates some blank lines for reasons I don't understand (I need to make an issue for that). I'm not totally comfortable with enforcing a style that is "you can never have more than one consecutive blank line," although in practice I don't think I write queries with more than one blank line in them. What rule(s) around blank lines should we try to enforce? |
Beta Was this translation helpful? Give feedback.
-
The opinion of some formatters for other languages
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) |
Beta Was this translation helpful? Give feedback.
The opinion of some formatters for other languages
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)