BusinessCentral.LinterCop icon indicating copy to clipboard operation
BusinessCentral.LinterCop copied to clipboard

Add an exception for LC0069

Open jwikman opened this issue 6 months ago • 3 comments

I think I understand the intent of LC0069, but we get this in a few places where I would consider it a false positive

In our company, we do require an else statement on all our case statements (that could be a new rule? 😅). And if there are nothing to do in the else part, we still require the else with an empty statement together with a comment.

case EnumValue of 
    SomeEnum::First:
       Message('Whatever);
    SomeEnum:Second:
        Message('Some message.');
    else
        ; // No other scenarios needs a message
end;

I suggest that exceptions for LC0069 are added, so that an empty statement is allowed if it is commented. I now see that similar thoughts are included in the discussion that resulted in this rule (https://github.com/StefanMaron/BusinessCentral.LinterCop/discussions/716#discussioncomment-10197633)

Thoughts?

jwikman avatar Aug 22 '24 12:08 jwikman