Ruleset hardening: promote AS0022, AA0087, AW0003, AA0203, AL0717 to Error - #10514
Ruleset hardening: promote AS0022, AA0087, AW0003, AA0203, AL0717 to Error#10514Jesper Schulz-Wedde (JesperSchulz) wants to merge 1 commit into
Conversation
…Error Removes five overrides from the shared base ruleset so these rules inherit Error from ./ruleset.json again. AS0022 has no violations in the repo, so it needed no code changes. The remaining four each had a handful of accepted violations, suppressed locally with tightly scoped pragmas rather than leaving the rule disabled repo-wide. Related to AB#640773 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 7e6fd312-fe92-4215-8333-f98ba0a2e25d
| DataClassification = EndUserIdentifiableInformation; | ||
| Caption = 'Container Type'; | ||
| } | ||
| #pragma warning disable AL0717 // Accepted: the FlowField is populated by code; adding a CalcFormula would change behavior. |
There was a problem hiding this comment.
This change suppresses AL0717 on "Has Errors", but "Script Editor Line" still declares it as a FlowField without a CalcFormula, and the reviewed Script Editor code only reads it through CalcFields/page access. In Business Central, FlowFields are virtual calculation fields; without a real CalcFormula this field will stay at its default value unless you change the design. Replace it with a normal Boolean populated when building the temporary editor lines, or add a real CalcFormula if the value truly comes from related data.
Agent judgement — not directly backed by a BCQuality knowledge article.
👍 useful · ❤️ especially valuable · 👎 wrong - reply with why · AL review agent v1.35.4
| TestField(Status, Status::Open); | ||
| end; | ||
| } | ||
| #pragma warning disable AL0717 // Accepted: these FlowFields are populated by code; adding a CalcFormula would change behavior. |
There was a problem hiding this comment.
This change suppresses AL0717 on "Requisites Quantity" and "Set Requisites Quantity", but "Statutory Report Data Header" still exposes them as FlowFields without CalcFormula. The reviewed code only calls CalcFields on them before reading their values, and no direct population path was found in the changed area. That makes the fields easy to misread as platform-calculated values even though FlowFields are expected to be calculation-backed virtual fields. Define real CalcFormula expressions for these counters, or convert them to normal Integer fields that the report-data update logic maintains explicitly.
Agent judgement — not directly backed by a BCQuality knowledge article.
👍 useful · ❤️ especially valuable · 👎 wrong - reply with why · AL review agent v1.35.4
Summary
Promotes five analyzer rules from
Warningback toErrorby removing their overrides from the sharedsrc/rulesets/base.ruleset.json, so they inheritErrorfrom./ruleset.jsonagain.AS0022AA0087AW0003AA0203AL0717Overrides: 94 → 89.
How the scope was established
Scope comes from a full diagnostic census rather than an estimate. Every
BuildOutput.txtartifact from a fully green PR build was parsed for warning diagnostics, attributed to its compiled project via the-project:argument on eachalc.exeinvocation, and deduplicated.That covers 855 of 877 projects. The 22 not covered are obsolete or otherwise excluded from CI (e.g.
WorldPayPaymentsStandard,UKPostcodeGetAddressIO).Only a green build gives a complete picture —
alcstops at the first project reporting an error, so any failed run undercounts.src/Views/**is generated fromsrc/Layersat build time, so a rule reported in 23 country views is one real source edit. All edits here are insrc/Layersorsrc/Apps.Accepted violations
Each remaining violation is suppressed with a tightly scoped pragma rather than leaving the rule disabled across the whole repo.
AA0087—LibraryJournalsES.Codeunit.alLibrary - Lower Permissionsis used from a helper reached via an event subscriber, not directly from a test procedure.AW0003—PurchaseDocumentEntity.Page.alA repeater containing a part on an API entity page. The page is never rendered in the Web client, so the restriction does not apply.
AA0203—MovementList.Report.alSetBreakbulkFiltercollides with a field name. It is a public method; renaming it would be a breaking change.AL0717—ScriptEditorLine.Table.al,StatutoryReportDataHeader.Table.alFlowFields without a
CalcFormula. These are populated from code; adding a formula would change behavior.Verification
src/rulesets/base.ruleset.jsonstill parses; diff is pure removals, no reformatting.AL0424deliberately left asWarning— it has no violations, but caused downstream issues previously.Validating propagation for 6 file(s)... SUCCESS: No missing filesRelated to AB#640773