-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LC0045 - Exceptions to the rule? #486
Comments
The examples you're referring to are indeed valid to assign to the zero ID. I could use your help on how we should change the logic of this rule to support these scenario's. At the moment the rule will verify that the Name (and Caption) need to be Empty. Applies a
I'm unsure on howto allow cases like these below, without breaking the consistency of the rule.
|
I think something like value(0; Undefined)
{
Caption = '', Locked = true;
} should be allowed. I think for some of the checks you could reuse things that were done in https://github.com/StefanMaron/BusinessCentral.LinterCop/blob/master/Design/Rule0014PermissionSetCaptionLength.cs, like checking for And/or for retrieving the But maybe I am misunderstanding what you are asking? 😅 |
That was not what I meant 😅 I'm looking for what defines a Enum that is Undefined/None intent? At the moment the rule expects Name (and Caption) need to be Empty. That makes the rule easy to understand. Do we hardcode that next to Empty also the values Undefined and None are acceptable? For example something like this; value(0; Empty)
{
Caption = 'Empty';
} |
I think there could be 2 things that we could address:
What do you think? |
We already have some enum objects where ID 0 is used for values with the name
Undefined
,None
, and/or withCaption = '', Locked = true;
(with the latter resulting in the enum value not showing as a selectable option in the BC client).Could it be considered that a LC0045 diagnostic is not raised in this case as the developer deliberately thought about the value with ID 0?
The text was updated successfully, but these errors were encountered: