Let’s continue our AL:Go pipelines Blog series.
Extending Business Central’s static analysis with your own CodeCop rules is a powerful way to enforce team-specific best practices and catch domain-specific pitfalls early.
AL:Go’s built-in customCodeCops parameter makes it trivial to drop your own CodeCop analyzer DLL into your Business Central build container.
In this demo we will be focusing on adding LinerCop CodeCop to your pipelines.
This code analyzer is meant to check your code for all sorts of problems. Be it code that technically compiles but will generate errors during runtime or more a kind of guideline check to achieve cleaner code.
Standard CodeCops
Before jumping into custom CodeCop, let’s check out parameters for standard Microsoft CodeCops:
"enableCodeCop": true,
"enableAppSourceCop": true,
"enablePerTenantExtensionCop": true,
"enableUICop": true,
"enableCodeAnalyzersOnTestApps": true,

Let’s unpack each setting:
- enableCodeCop Turns on the classic CodeCop rules that enforce AL best practices (naming conventions, unnecessary loops, performance traps, etc.). This is your baseline for clean, maintainable AL code.
- enableAppSourceCop Validates your extension against AppSource certification requirements: object IDs, localized labels, telemetry settings, and mandatory metadata. It’s essential if you plan to publish to Microsoft AppSource.
- enablePerTenantExtensionCop Checks for your per tenant extension compatibility issues— if you don’t plan to publish to Microsoft AppSource, it means you will be using your app as PTE, so enabling this CodeCop would be a good idea.. Enable this to catch platform-incompatible code early.
- enableUICop Applies UI-specific rules: page layout recommendations, accessibility checks, and consistency of captions/tooltips. A must for any app surface area your end users will see.
- enableCodeAnalyzersOnTestApps By default, analyzers skip code in test projects. Setting this to true forces CodeCop and friends to run against your test AL apps too—catch dead code, misnamed tests, or unsupported test-only patterns.

As you can see, now pipeline is running with enabled CodeCop’s, in this case intentionally left errors and enabled AppSource cop, which got errors in pipeline.
Custom CodeCops (Business Central LinerCop)
Let’s move now to custom CodeCops like LinerCop.
First I downloaded LinterCop and added it to code analyzers:

Made example which will trigger LinterCop rule:

So, that’s how it’s working locally. But how to enable it automatically to validate on pipeline CI/CD build?
In AL-Go settings file you have parameter:
customCodeCops | CustomCodeCops is an array of paths or URLs to custom Code Cop DLLs you want to enable when building. | [ ] |
So, where to get that DLL? For LinterCop, it’s available on GitHub public repository, under releases:
Releases · StefanMaron/BusinessCentral.LinterCop
Just copy link to a DLL:

Add it under AL-Go Settings.json:

Let’s run now the pipeline!

Custom CodeCop is downloaded into the container, and its rules are validated. Simple as that!
By adding custom CodeCops into your pipeline, you increase your organization’s standards, reduce manual code reviews, and ship higher-quality extensions faster. Go ahead—define the rules that matter most to your team, and let your pipeline enforce them! 🚀
Subscribe to our email newsletter to get the latest posts delivered right to your email.
Comments