Skip to content

Commit ee4e62c

Browse files
Rename AutoFix switch to NoAuthFix in Update-PesterTest
Replaces the -AutoFix switch with -NoAuthFix in the Update-PesterTest function. The new switch disables automatic PSScriptAnalyzer fixes, which are now enabled by default unless -NoAuthFix is specified. Updates parameter documentation and logic accordingly.
1 parent 6ac3ce9 commit ee4e62c

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

.aitools/aitools.psm1

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,9 @@ function Update-PesterTest {
7676
.PARAMETER PassCount
7777
Sometimes you need multiple passes to get the desired result.
7878
79-
.PARAMETER AutoFix
80-
If specified, automatically runs PSScriptAnalyzer after AI modifications and attempts to fix any violations found.
81-
This feature runs separately from PassCount iterations and uses targeted fix messages.
79+
.PARAMETER NoAuthFix
80+
If specified, disables automatic PSScriptAnalyzer fixes after AI modifications.
81+
By default, autofix is enabled and runs separately from PassCount iterations using targeted fix messages.
8282
8383
.PARAMETER AutoFixModel
8484
The AI model to use for AutoFix operations. Defaults to the same model as specified in -Model.
@@ -138,7 +138,7 @@ function Update-PesterTest {
138138
[string]$Tool = 'Claude',
139139
[switch]$AutoTest,
140140
[int]$PassCount = 1,
141-
[switch]$AutoFix,
141+
[switch]$NoAuthFix,
142142
[string]$AutoFixModel = $Model,
143143
[int]$MaxRetries = 0,
144144
[string]$SettingsPath = (Resolve-Path "$PSScriptRoot/../tests/PSScriptAnalyzerRules.psd1" -ErrorAction SilentlyContinue).Path,
@@ -369,7 +369,7 @@ function Update-PesterTest {
369369
}
370370

371371
# AutoFix workflow - run PSScriptAnalyzer and fix violations if found
372-
if ($AutoFix) {
372+
if (-not $NoAuthFix) {
373373
Write-Verbose "Running AutoFix for $cmdName"
374374
$autoFixParams = @{
375375
FilePath = $filename

0 commit comments

Comments
 (0)