Skip to content
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 rules: Missing brackets - Triggers on Temporary records - Non-Public Event Publishers #830

Conversation

tinestaric
Copy link
Contributor

@tinestaric tinestaric commented Dec 12, 2024

This PR introduces three new rules that were part of the discussion here:
#776

Missing brackets

If a procedure is missing brackets, there's a standard rule that throws a warning, however, some internal methods are not covered by that rule. This rule introduces a warning for a few more of the most common cases (Today, WorkDate, GuiAllowed, IsEmpty, Count)

This list could be extended further; I could use some input on that front.

Triggers on Temporary Records

When triggers are executed on a temporary record variable, the temporary scope no longer applies to any code in those triggers and can lead to unwanted database changes. This rule introduces a warning that triggers (Insert, Modify, Delete, DeleteAll, ModifyAll) and Validate should not be executed on temporary record variables.

The rule does not throw a warning if the table itself is of type temporary, as it's expected that its triggers are created safely.

Non-Public Event Publisher

When an event publisher is declared as public, you cannot add parameters to it, as AppSourceCop treats it as a breaking change to a public API. Local and Internal publishers on the other hand do not have this issue. In order to keep the option of extending the publishers later, the events should be declared as either local or internal

@tinestaric tinestaric changed the base branch from master to prerelease December 12, 2024 01:43
Copy link
Collaborator

@Arthurvdv Arthurvdv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for taking the time and effort to bring these rules to LinterCop, they look great!

I’ve added a few minor remarks, with the most important being to lower the default severity from Warning to Info. As a general rule of thumb, I usually reserve warning for scenarios that could lead to (run)time errors.

If you have any concerns or feel differently about the remarks I’ve added, please don’t hesitate to share your thoughts on them.

And again thank you for these contributions 🤗

tinestaric and others added 6 commits December 12, 2024 20:39
Co-authored-by: Arthur van de Vondervoort <44637996+Arthurvdv@users.noreply.github.com>
Co-authored-by: Arthur van de Vondervoort <44637996+Arthurvdv@users.noreply.github.com>
@Arthurvdv Arthurvdv merged commit f56d4cd into StefanMaron:prerelease Dec 13, 2024
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants