Make AA0194 an error in the base ruleset - #10086
Make AA0194 an error in the base ruleset#10086Magnus Hartvig Grønbech (Groenbech96) wants to merge 3 commits into
Conversation
|
Could not find a linked ADO work item. Please link one by using the pattern 'AB#' followed by the relevant work item number. You may use the 'Fixes' keyword to automatically resolve the work item when the pull request is merged. E.g. 'Fixes AB#1234' |
…ion triggers Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: b6f3c139-b1a1-4b39-8864-cffb67ef6212
|
Removing the AA0194 override from src/rulesets/base.ruleset.json is a real build-policy tightening, not a no-op cleanup: base.ruleset.json includes ./ruleset.json (action: Default), which itself includes ./CodeCop.ruleset.json with an explicit action:'Error' override, and CodeCop.ruleset.json sets AA0194 to 'Error'. With the removed entry, AA0194 ('specify either the OnAction trigger or the RunObject property on an action') reverts from the previously-pinned 'Warning' to 'Error' for every project compiled with base.ruleset.json (base.ruleset.json is referenced as the BaseApp ruleset from build/projects.json and .github/AL-Go-Settings.json across country/W1 layers). This PR only fixes the 2 empty-body OnAction triggers it touches (PostedFAWriteoffAct.Page.al, PageFields.Page.al), but at least 4 other pre-existing empty-body OnAction triggers remain unfixed in the same BaseApp layers and will now fail to compile as AA0194 errors instead of warnings: src/Layers/W1/BaseApp/Foundation/Company/Companies.Page.al (~line 135, action 'Create New Company'), and src/Layers/DE/BaseApp/Finance/VAT/Reporting/ECSLReport.Page.al (~lines 224, 237, 250 — actions Log Entries/Release/Reopen, each with only a commented-out MESSAGE call). Because the impact (a broken build) would otherwise be major/blocker, this should be promoted to a knowledge-backed breaking-changes rule rather than staying an unbacked agent finding; in the meantime, either add the same Suggested fix (apply manually — could not be anchored as a one-click suggestion): {
"id": "AA0189",
"action": "Warning"
},
{
"id": "AA0194",
"action": "Warning",
"justification": "Remember to specify either the 'OnAction' trigger or the 'RunObject' property on an action."
},
{
"id": "AA0198",
"action": "Warning",
"justification": "The name of the local variable is identical to a global variable."
},Agent judgement — not directly backed by a BCQuality knowledge article. Line mapping was unavailable, so this was posted as an issue comment. 👍 useful · ❤️ especially valuable · 👎 wrong - reply with why · AL review agent v1.31.4 |
Add explicit no-op OnAction triggers to hidden override actions on the VAT Return Period Card/List pages and to the commented-out ECSL Report actions. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: b6f3c139-b1a1-4b39-8864-cffb67ef6212
|
This PR removes the AA0194 suppression entry (with its justification) from the shared base ruleset src/rulesets/base.ruleset.json, which changes the analyzer contract for every consumer that references this ruleset. Any project still containing actions without OnAction/RunObject that this PR did not touch will now start surfacing AA0194 diagnostics, potentially breaking other builds/PRs that rely on the previous blanket suppression. Treat this as a build-contract change that should be coordinated with a sweep of other affected objects, or confirm no other repo-wide occurrences remain before merging. Line mapping was unavailable, so this was posted as an issue comment. 👍 useful · ❤️ especially valuable · 👎 wrong - reply with why · AL review agent v1.31.4 |
| trigger OnAction() | ||
| begin | ||
| // MESSAGE('Show errors'); | ||
| exit; |
There was a problem hiding this comment.
This PR removes the global AA0194 suppression, but the replacement in these page actions is a bare exit; at the end of OnAction(). In a void OnAction that statement is a semantic no-op, so the action still does nothing; it mainly serves to silence the analyzer rather than express real behavior. If a no-op action is truly intentional (for example to override default handling), keep that exceptional case narrowly documented/suppressed; otherwise give the action a real RunObject/OnAction implementation or remove/hide the placeholder action instead of using exit; as an analyzer workaround. The same pattern repeats across ECSLReport.Page.al, VATReturnPeriodCard.Page.al (DE/IT), VATReturnPeriodList.Page.al (DE/IT), PostedFAWriteoffAct.Page.al, and PageFields.Page.al.
👍 useful · ❤️ especially valuable · 👎 wrong - reply with why · AL review agent v1.31.4
Removes the
AA0194override fromsrc/rulesets/base.ruleset.json.The ruleset declares
"generalAction": "Error", so removing the explicit"action": "Warning"entry promotes AA0194 to an error for the base application.AA0194: Remember to specify either the
OnActiontrigger or theRunObjectproperty on an action.