Skip to content

Latest commit

 

History

History
129 lines (92 loc) · 3.08 KB

Invoke-AvmLint.md

File metadata and controls

129 lines (92 loc) · 3.08 KB

Invoke-AvmLint

Synopsis

Lint all source files in the resolved module under $Path.

Description

Routes to the engine matching the module's ecosystem:

  • bicep -> Invoke-AvmBicepLint ('bicep lint ' per file)
  • terraform -> Invoke-AvmTerraformLint (AVM tflint rulesets, per scope)

The ecosystem is determined by Get-AvmModuleContext, which honours the .avm/context.psd1 override file and the -Ecosystem filter.

Returns an envelope with structured Issue records; callers should treat Status='fail' as a failed lint pass.

Terraform findings at the failure threshold are also logged as source-linked errors when lint completes, before subsequent composition steps. The default threshold includes warnings and errors. This changes presentation only: Issue severity and the returned result stay intact. Advisory AVM notices remain warnings below the threshold, and final dispatcher output does not repeat findings already presented by lint.

Routed by the dispatcher: 'avm lint'.

CLI commands

  • avm lint

Syntax

Invoke-AvmLint [[-Path] <string>] [-Ecosystem <string>] [-AllowPathFallback] [-ThrottleLimit <int>] [-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

-Path

Working directory whose enclosing module to lint. 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

-ThrottleLimit

Maximum number of independent Terraform scopes to process at once. Defaults to four. Bicep lint currently ignores this value.

Property Value
Type Int32
Required false
Position named
Default value 4
Accept pipeline input false
Accept wildcard characters false

Examples

EXAMPLE 1

avm lint

EXAMPLE 2

Invoke-AvmLint -Path C:\repos\my-module -Ecosystem bicep

Outputs

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