Skip to content

Ruleset hardening: promote AS0022, AA0087, AW0003, AA0203, AL0717 to Error - #10514

Open
Jesper Schulz-Wedde (JesperSchulz) wants to merge 1 commit into
mainfrom
jesperschulz-ruleset-batch-a
Open

Ruleset hardening: promote AS0022, AA0087, AW0003, AA0203, AL0717 to Error#10514
Jesper Schulz-Wedde (JesperSchulz) wants to merge 1 commit into
mainfrom
jesperschulz-ruleset-batch-a

Conversation

@JesperSchulz

@JesperSchulz Jesper Schulz-Wedde (JesperSchulz) commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Summary

Promotes five analyzer rules from Warning back to Error by removing their overrides from the shared src/rulesets/base.ruleset.json, so they inherit Error from ./ruleset.json again.

Rule Violations Change
AS0022 none ruleset only
AA0087 1 1 pragma
AW0003 1 1 pragma
AA0203 1 1 pragma
AL0717 3 (2 files) 2 pragmas

Overrides: 94 → 89.

How the scope was established

Scope comes from a full diagnostic census rather than an estimate. Every BuildOutput.txt artifact from a fully green PR build was parsed for warning diagnostics, attributed to its compiled project via the -project: argument on each alc.exe invocation, 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 — alc stops at the first project reporting an error, so any failed run undercounts.

src/Views/** is generated from src/Layers at build time, so a rule reported in 23 country views is one real source edit. All edits here are in src/Layers or src/Apps.

Accepted violations

Each remaining violation is suppressed with a tightly scoped pragma rather than leaving the rule disabled across the whole repo.

  • AA0087LibraryJournalsES.Codeunit.al
    Library - Lower Permissions is used from a helper reached via an event subscriber, not directly from a test procedure.

  • AW0003PurchaseDocumentEntity.Page.al
    A repeater containing a part on an API entity page. The page is never rendered in the Web client, so the restriction does not apply.

  • AA0203MovementList.Report.al
    SetBreakbulkFilter collides with a field name. It is a public method; renaming it would be a breaking change.

  • AL0717ScriptEditorLine.Table.al, StatutoryReportDataHeader.Table.al
    FlowFields without a CalcFormula. These are populated from code; adding a formula would change behavior.

Verification

  • src/rulesets/base.ruleset.json still parses; diff is pure removals, no reformatting.
  • AL0424 deliberately left as Warning — it has no violations, but caused downstream issues previously.
  • Local layer propagation gate passes:
    Validating propagation for 6 file(s)... SUCCESS: No missing files

Related to AB#640773

…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
@github-actions github-actions Bot added AL: Apps (W1) Add-on apps for W1 Other GitHub request for other area than SCM, Finance or Integration Ownership: Needs Review Ownership is Other, low confidence, or needs manual correction labels Aug 21, 2026
@github-actions github-actions Bot added this to the Version 29.0 milestone Aug 21, 2026
DataClassification = EndUserIdentifiableInformation;
Caption = 'Container Type';
}
#pragma warning disable AL0717 // Accepted: the FlowField is populated by code; adding a CalcFormula would change behavior.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

$\textbf{🟡\ Medium\ Severity\ —\ Data\ Modeling}$

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

$\textbf{🟡\ Medium\ Severity\ —\ Data\ Modeling}$

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AL: Apps (W1) Add-on apps for W1 Other GitHub request for other area than SCM, Finance or Integration Ownership: Needs Review Ownership is Other, low confidence, or needs manual correction

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant