integrated-application-development / integrated-application-development/pasfmt

Remove empty lines in some cases

Open
#186 1 comment 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Rust
Stars
105
Forks
20
PR merge metrics
No merged PRs in 30d

Description

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
```delphi
begin
A;
end;

try
A;
finally
B;
end;
```

### routine declarations should follow and precede a blank line
```delphi
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
```delphi
type
A = B;
C = D;

const
A = '';
B = 0;
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.