Sync eng/common directory with azure-sdk-tools for PR 14308#48220
Sync eng/common directory with azure-sdk-tools for PR 14308#48220
Conversation
There was a problem hiding this comment.
Pull request overview
Syncs eng/common spellcheck behavior with azure-sdk-tools by improving how the changed-files spellcheck script interprets failures from the underlying cspell invocation.
Changes:
- Capture cspell’s process exit code after invoking
Invoke-Cspell.ps1. - Fail the script (when
-ExitWithErroris set) if cspell exits non-zero even when no spelling output is produced.
| } elseif ($cspellExitCode -ne 0 -and $ExitWithError) { | ||
| LogError "CSpell exited with code $cspellExitCode. This may indicate a configuration error or other failure in the spell checking tool." | ||
| exit 1 |
There was a problem hiding this comment.
The new $cspellExitCode handling still reports success when Invoke-Cspell.ps1 fails but -ExitWithError isn’t set: the script will fall into the final else and print "No spelling errors detected" while returning 0. Consider treating non-zero cspell exit codes as failures (or at least logging a warning and exiting with the same non-zero code) regardless of -ExitWithError, so CI tasks configured with continueOnError: true still surface tool/config failures as a warning rather than a silent pass.
| } elseif ($cspellExitCode -ne 0 -and $ExitWithError) { | |
| LogError "CSpell exited with code $cspellExitCode. This may indicate a configuration error or other failure in the spell checking tool." | |
| exit 1 | |
| } elseif ($cspellExitCode -ne 0) { | |
| if ($ExitWithError) { | |
| LogError "CSpell exited with code $cspellExitCode. This may indicate a configuration error or other failure in the spell checking tool." | |
| } else { | |
| LogWarning "CSpell exited with code $cspellExitCode. This may indicate a configuration error or other failure in the spell checking tool." | |
| } | |
| exit $cspellExitCode |
Sync eng/common directory with azure-sdk-tools for PR Azure/azure-sdk-tools#14308 See eng/common workflow