While we let users keep at most one blank line to improve readability of code, there are some cases where we could be a bit more assertive and remove (or add) a blank line.
Here are some initial thoughts for how a rule like this could work. I'm interested in hearing other opinions on the matter.
statement lists should not start or end with a blank line
begin
A;
end;
try
A;
finally
B;
end;
routine declarations should follow and precede a blank line
procedure A;
begin
end;
procedure B;
begin
end;
// comments are
// still 'attached'
[SoAreAttributes]
procedure C;
begin
end;
// trailing comments are 'detached'
type, const, var, threadvar blocks should not start with a blank line
type
A = B;
C = D;
const
A = '';
B = 0;
While we let users keep at most one blank line to improve readability of code, there are some cases where we could be a bit more assertive and remove (or add) a blank line.
Here are some initial thoughts for how a rule like this could work. I'm interested in hearing other opinions on the matter.
statement lists should not start or end with a blank line
routine declarations should follow and precede a blank line
type,const,var,threadvarblocks should not start with a blank line