Skip to content

Commit 06b1798

Browse files
authored
Changes required for testing upgrades to cspell (#53947)
* CustomCondition * Add spell-check-public-api.ps1 * Wire up check-spelling.yml * TEST REVERT: check-spelling.yml * TEST REVERT: Trivial change to eng/spelling/package-lock.json * Fix check-spelling.yml * exit 0 * Add baseline * Remove extra param * Test misspelling * Revert test changes * Review feedback * Review feedback * Add support for RelativePackagePath or ServiceDirectory * Remove extra logging * Use Export-API.ps1 from main * Use scenario-specific spell-check-public-api.ps1 * Revert check-spelling.yml
1 parent 2389961 commit 06b1798

File tree

4 files changed

+43
-3
lines changed

4 files changed

+43
-3
lines changed

eng/pipelines/templates/jobs/ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,8 @@ jobs:
158158
- template: /eng/common/pipelines/templates/steps/validate-filename.yml
159159

160160
- template: /eng/common/pipelines/templates/steps/check-spelling.yml
161+
parameters:
162+
ScriptToValidateUpgrade: eng/scripts/spell-check-public-api.ps1
161163

162164
- template: /eng/common/pipelines/templates/steps/verify-links.yml
163165
parameters:

eng/scripts/Export-API.ps1

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,18 @@ foreach ($file in $apiListingFiles) {
5151
}
5252

5353
if ($SpellCheckPublicApiSurface) {
54-
Write-Host "Spell check public API surface (found $($apiListingFiles.Count) files)"
55-
&"$PSScriptRoot/../common/spelling/Invoke-Cspell.ps1" `
56-
-FileList $apiListingFiles.FullName
54+
Write-Host "Spell check public API surface"
55+
56+
if ($PSCmdlet.ParameterSetName -eq 'PackagePath') {
57+
&"$PSScriptRoot/spell-check-public-api.ps1" `
58+
-RelativePackagePath $relativePackagePath
59+
} else {
60+
&"$PSScriptRoot/spell-check-public-api.ps1" `
61+
-ServiceDirectory $relativePackagePath
62+
}
5763

5864
if ($LASTEXITCODE) {
5965
Write-Host "##vso[task.LogIssue type=error;]Spelling errors detected. To correct false positives or learn about spell checking see: https://aka.ms/azsdk/engsys/spellcheck"
66+
exit $LASTEXITCODE
6067
}
6168
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
param(
2+
$ServiceDirectory = '',
3+
$RelativePackagePath = ''
4+
)
5+
6+
if ($ServiceDirectory -and $RelativePackagePath) {
7+
throw "Cannot specify both ServiceDirectory and RelativePackagePath parameters."
8+
}
9+
10+
Set-StrictMode -Version 3.0
11+
."$PSScriptRoot/../common/scripts/common.ps1"
12+
13+
$files = @()
14+
if ($ServiceDirectory) {
15+
$files = Get-ChildItem -Path "$PSScriptRoot/../../sdk/$ServiceDirectory/*/api/*.cs" -File
16+
} elseif ($RelativePackagePath) {
17+
$files = Get-ChildItem -Path "$PSScriptRoot/../../sdk/$RelativePackagePath/api/*.cs" -File
18+
} else {
19+
$files = Get-ChildItem -Path "$PSScriptRoot/../../sdk/*/*/api/*.cs" -File
20+
}
21+
22+
Write-Host "Found $($files.Count) public API surface files to spell check."
23+
."$PSScriptRoot/../common/spelling/Invoke-Cspell.ps1" `
24+
-CSpellConfigPath "./.vscode/cspell.json" `
25+
-FileList $files.FullName

sdk/recoveryservices/cspell.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import:
2+
- ../../.vscode/cspell.json
3+
overrides:
4+
- filename: '**/sdk/recoveryservices/**'
5+
words:
6+
- bcdr

0 commit comments

Comments
 (0)