-
Notifications
You must be signed in to change notification settings - Fork 32
LC0069
Arthur van de Vondervoort edited this page Sep 21, 2024
·
5 revisions
Empty statements should be avoided or should have a leading or trailing comment explaining their use.
This rule detects and flags empty statement expressions (excess semicolons) for improved readability and cleaner code.
local procedure Example(SomeVar: Boolean)
begin
if SomeVar then begin
; <<-- this excess semicolon should be removed
Message('hello');
Message('world');
end;
; <<-- same here
end;
case EnumValue of
SomeEnum::First:
Message('Whatever');
SomeEnum:Second:
Message('Some message.');
else
; // No other scenarios needs a message
end;
In some cases, an empty statement makes sense, and adding a comment justifying its existence will suppress the rule.