Conversation
…ages automatically
…d pull request descriptions.
…ructions handling
|
This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation. |
| @@ -0,0 +1,70 @@ | |||
| function Get-AiMessageForCommit{ | |||
Check notice
Code scanning / PSScriptAnalyzer
The cmdlet 'Get-AiMessageForCommit' does not have a help comment. Note
| $gitdifff = git diff --staged | ||
|
|
||
| if ([string]::IsNullOrWhiteSpace($gitdifff)) { | ||
| Write-Host "No staged changes found. Please stage your changes before generating a commit message." -ForegroundColor Yellow |
Check warning
Code scanning / PSScriptAnalyzer
File 'getCommitPrompt.ps1' uses Write-Host. Avoid using Write-Host because it might not work in all hosts, does not work when there is no host, and (prior to PS 5.0) cannot be suppressed, captured, or redirected. Instead, use Write-Output, Write-Verbose, or Write-Information. Warning
| $p = @() | ||
| $p += "Follow these instructions: [ $instructions ]" | ||
| $sysPrompt = $p -join "`n" | ||
|
|
Check notice
Code scanning / PSScriptAnalyzer
Line has trailing whitespace Note
|
|
||
| $message = gh models run $Model "$usrprompt" --system-prompt $sysPrompt | ||
|
|
||
| $global:message = $message | Out-String |
Check warning
Code scanning / PSScriptAnalyzer
Found global variable 'global:message'. Warning
|
|
||
| } Export-ModuleMember -Function Get-AiMessageForCommit -Alias aicm | ||
|
|
||
| function Get-Instructions{ |
Check warning
Code scanning / PSScriptAnalyzer
The cmdlet 'Get-Instructions' uses a plural noun. A singular noun should be used instead. Warning
| $content = Get-Content -Path $instructionsPath -Raw | ||
| return $content | ||
| } | ||
|
|
Check notice
Code scanning / PSScriptAnalyzer
Line has trailing whitespace Note
Get a commit message based on git staged changes and instructions