Skip to content

Latest commit

 

History

History
142 lines (104 loc) · 3.44 KB

Invoke-AvmCheckConvention.md

File metadata and controls

142 lines (104 loc) · 3.44 KB

Invoke-AvmCheckConvention

Synopsis

Run convention checks against the resolved module.

Description

Routes to the engine matching the module's ecosystem:

  • bicep -> first-party layout, version, changelog, test-source, compiled ARM, checked-in JSON, workflow, and CODEOWNERS checks
  • terraform -> built-in AVM convention rules

The ecosystem is determined by Get-AvmModuleContext, which honours the .avm/context.psd1 override file and the -Ecosystem filter. Bicep workflow checks require powershell-yaml 0.4.12, loaded only when a module workflow is inspected. Install it separately with Install-PSResource; missing or invalid YAML fails the check. Bicep rules run in process as the packaged Pester suite under Resources/bicep/conventions, so Pester 5.5.0 or later must be installed. A rule that throws is reported as an error issue.

Routed by the dispatcher: 'avm check convention'.

CLI commands

  • avm check convention

Syntax

Invoke-AvmCheckConvention [[-Path] <string>] [-Ecosystem <string>] [-AllowPathFallback] [-Fix] [-FixableOnly] [-SkipModuleVersionCheck] [<CommonParameters>]

Parameters

-AllowPathFallback

When set, accept a PATH-resolved tool binary that self-reports the lock-pinned version.

Property Value
Type Switch
Required false
Position named
Default value False
Accept pipeline input false
Accept wildcard characters false

-Ecosystem

Force the ecosystem selector. Defaults to 'auto'.

Property Value
Type String
Required false
Position named
Default value auto
Accept pipeline input false
Accept wildcard characters false

-Fix

When set, rule primitives that declare a fix path apply it (e.g. renaming output.tf to outputs.tf, appending missing globs to .gitignore). Without -Fix the verb is check-only.

Property Value
Type Switch
Required false
Position named
Default value False
Accept pipeline input false
Accept wildcard characters false

-FixableOnly

Evaluate only rules that declare a deterministic fix. Pre-commit uses this with -Fix; standalone checks and pr-check evaluate every rule.

Property Value
Type Switch
Required false
Position named
Default value False
Accept pipeline input false
Accept wildcard characters false

-Path

Working directory whose enclosing module to check. Defaults to the current location.

Property Value
Type String
Required false
Position 1
Default value $PWD.Path
Accept pipeline input false
Accept wildcard characters false

-SkipModuleVersionCheck

Skip the PowerShell Gallery check that otherwise stops the command when a newer Avm.Authoring version is available. Writes a warning once.

Property Value
Type Switch
Required false
Position named
Default value False
Accept pipeline input false
Accept wildcard characters false

Examples

EXAMPLE 1

avm check convention

EXAMPLE 2

Invoke-AvmCheckConvention -Path C:\repos\my-tf-module -Ecosystem terraform

Outputs

  • pscustomobject from the engine: Engine, Tool, ToolPath, ToolSource, Status, Issues.