Skip to content

Commit

Permalink
fix scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
potatoqualitee committed Oct 18, 2024
1 parent bdabe38 commit a80f91e
Show file tree
Hide file tree
Showing 5 changed files with 548 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .aider/fix-tests.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
param (
[int]$First = 1000,
[int]$Skip = 0
)
$testerrors = Get-Content /workspace/.aider/prompts/fix-errors.json | ConvertFrom-Json

$promptTemplate = Get-Content /workspace/.aider/prompts/fix-template.md
$commands = $testerrors | Select-Object -First $First -Skip $Skip
$added = @()

foreach ($command in $commands) {
$cmdName = $command.Command
$filename = "/workspace/tests/$cmdName.Tests.ps1"
Write-Host "Processing $cmdName"

if (-not (Test-Path $filename)) {
Write-Warning "No tests found for $cmdName"
Write-Warning "$filename not found"
continue
}

$cmdPrompt = $promptTemplate -replace "--CMDNAME--", $cmdName

# Run Aider in non-interactive mode with auto-confirmation
if ($added -notcontains $cmdName) {
$added += $cmdName
aider --message "$cmdPrompt" --file $filename --sonnet --no-stream --cache-prompts --read /workspace/.aider/prompts/conventions.md /workspace/.aider/prompts/types.md /workspace/.aider/prompts/errors.md
} else {
aider --message "$cmdPrompt" --sonnet --no-stream --cache-prompts --read /workspace/.aider/prompts/conventions.md /workspace/.aider/prompts/types.md
}
}
Empty file added .aider/prompts/errors.md
Empty file.
Loading

0 comments on commit a80f91e

Please sign in to comment.