-
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
New rule to check IsHandled set to false #772
New rule to check IsHandled set to false #772
Conversation
Not quite sure what's going on with the failing versions, or rather how to check / fix those. |
First, I apologize for the delay in responding to this PR. The reason for the wait is that I've been considering the best solution for handling the failing versions, going back and forth on different approaches. My initial though to just suggest slapping a preprocessor directive around the rule, excluding this rule for older AL Language versions, like for example on the Rule0035. Line 1 in 6c7a4c5
Root cause ... then I thought: These are old pre-release versions of the v12. Do we really need to have assets for these versions? 🤔 Some more feedback on your remarks
I would suggest
If I understand this correctly, this potentially could raise a false positive? For now I would leave it as is and gather feedback on this in the pre-release version of the LinterCop.
The same as above, lets try this out in de pre-release and see if this implementation is viable. I have another suggestion maybe: Next to It could be opportune to also include this keyword in your rule? |
Thanks, that seems to work!
Updated the wording.
Yes, a false positive in a sense that the actual value is true, just wrapped in a variable or procedure return value. Although I'd argue if it's guaranteed to be true at compile time, might as well use
Thanks, I've added |
Looks great! Let's merge this into the pre-release to gather some feedback. Thank you for your patience on this PR and I apologize for the delay (these past few weeks have been swamped with work, and I wish I could have handled your PR sooner). |
Implements a new rule for the discussion #715.
The intent of the rule is to disallow setting IsHandled to false, as that may overwrite IsHandled if it was set by a previous event subscriber, which may then cause issues.
Few points I am unsure about:
true
. Even having something likemyVar := true; IsHandled := myVar;
is not allowed as i could not find a way to check (reliably) if a variable / procedure is guaranteed to betrue
.var
parameter to another procedure for the same reason as above. So a "wrapper" like below will also raise the diagnostic: