Run ALCops custom code analyzers in your AL-Go pipelines, with a single script hook.
AL-Go supports custom pipeline hooks that run at specific stages of a build. This repo provides an installer script that plugs into AL-Go though the PipelineInitialize.ps1 hook to automatically download and configure ALCops analyzers before compilation starts.
- Create a file called
PipelineInitialize.ps1in your.AL-Gofolder. - Add the following content:
Param([Hashtable] $parameters)
# Configuration
$scriptUrl = "https://raw.githubusercontent.com/ALCops/AL-Go/v1.0.0/scripts/Install-ALCops.ps1"
# Download and run the installer script
$scriptPath = Join-Path ([System.IO.Path]::GetTempPath()) "Install-ALCops.ps1"
Invoke-WebRequest -Uri $scriptUrl -OutFile $scriptPath -UseBasicParsing
& $scriptPath| Parameter | Default | Description |
|---|---|---|
$packageVersion |
"" |
Version channel: "" (latest stable), "alpha", "beta", or an exact version like "1.2.3" |
$targetFramework |
net8.0 |
Leave blank for current AL Language versions. Set to netstandard2.1 for AL Language versions below v16.0. |
When AL-Go runs the PipelineInitialize hook, the script:
- Downloads
Install-ALCops.ps1from this repo. - The installer resolves the requested analyzer package version from NuGet.
- Extracts the analyzer DLLs into the workspace so AL-Go picks them up as custom code cops.
For detailed documentation, rule descriptions, and configuration guidance, visit alcops.dev.