URLs in includeRuleSets

Important

This content is archived and is not being updated. For the latest documentation, go to What's new and planned for Dynamics 365 Business Central. For the latest release plans, go to Dynamics 365, Power Platform, and Cloud for Industry release plans.

Enabled for Public preview General availability
Admins, makers, marketers, or analysts, automatically Mar 1, 2023 Apr 1, 2023

Business value

Business Central comes with a set of code analyzer rules, such as for PTEs and AppSource, and even enforces many for the latter when submitting apps. See Code analyzers for more.

Until now, each project or workspace would have to define their own rule sets in the ruleset file, making it hard to share, maintain (for example, when new rules are introduced), and prescribe a common rule set across apps. However, we are now adding the support to use URLs in the ruleset file, allowing maintenance of rule sets in a single, shared location.

Feature details

Take advantage of new support for URLs in CodeCop rule sets to easily share, maintain, and enforce common rules. There are two ways to add rules via URLs.

Add URL to rules in settings.json

The settings file now contains two new properties to handle external ruleset files. You can point to an external location by using the al.ruleSetPath property, and you can control whether the path is used through the new al.enableExternalRulesets property.

Use URLs in al.ruleSetPath to easily share, maintain, and enforce rules across projects

Add URL to rules in the ruleset file

You can also refer to external rule sets from the ruleset file, by adding the URL locations to the path property in the includedRuleSets, which until now only supported files.

{
    "name": "Personal Project ruleset",
    "description": "A list of project specific rules",
    "includedRuleSets": [
        {
            "action": "Default",
            "path": "https://bcartifacts.azureedge.net/rulesets/appsource.default.ruleset.json"
        }
    ],
    ...
    ]
}

This feature can be used from the alc.exe command line tool as well by including the -enableexternalrulesets argument.

Tell us what you think

Help us improve Dynamics 365 Business Central by discussing ideas, providing suggestions, and giving feedback. Use the forum at https://aka.ms/bcideas.

Thank you for your idea

Thank you for submitting this idea. We listened to your idea, along with comments and votes, to help us decide what to add to our product roadmap.

See also

Ruleset for the Code Analysis Tools (docs)