-
Notifications
You must be signed in to change notification settings - Fork 6
Description
I think that vertical spacing is an important factor when talking about legibility of the code.
And I noticed that the current formatting completely removes every blank line, which makes some files hard to read, as the code is blended together.
My solution to this would be adding a blank line after every semicolon. This is a simple rule, but seems to make a big difference at first glance. There are at least two exceptions, though:
-
Do not insert a blank line after line with
within
statement (as it looks a bit strange to have a blank line there. I need to check, but I think that Dymola would remove such blank line after saving a file). -
Do not insert a blank line after semicolons that are part of matrix notation (as having a blank line there would rather decrease readability).
So this should be the desired output for matrices:
parameter Integer[2,2] A = [ 1,2; 3,4];
I've managed to find a way to achieve it, see PR #31
However, the current solution has one bug: it leaves two blank lines at the end of files that end with a semicolon.
I am also not sure about my approach, maybe there's a better way to achieve this output.
And also, what do you think about this idea? Maybe you strip the blank lines because of some concrete reason?