Skip to content

Remove empty lines in some cases #186

Description

@zaneduffield

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;

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions