Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions eng/pipelines/templates/jobs/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,8 @@ jobs:
- template: /eng/common/pipelines/templates/steps/validate-filename.yml

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

- template: /eng/common/pipelines/templates/steps/verify-links.yml
parameters:
Expand Down
13 changes: 10 additions & 3 deletions eng/scripts/Export-API.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,18 @@ foreach ($file in $apiListingFiles) {
}

if ($SpellCheckPublicApiSurface) {
Write-Host "Spell check public API surface (found $($apiListingFiles.Count) files)"
&"$PSScriptRoot/../common/spelling/Invoke-Cspell.ps1" `
-FileList $apiListingFiles.FullName
Write-Host "Spell check public API surface"

if ($PSCmdlet.ParameterSetName -eq 'PackagePath') {
&"$PSScriptRoot/spell-check-public-api.ps1" `
-RelativePackagePath $relativePackagePath
} else {
&"$PSScriptRoot/spell-check-public-api.ps1" `
-ServiceDirectory $relativePackagePath
}

if ($LASTEXITCODE) {
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"
exit $LASTEXITCODE
}
}
25 changes: 25 additions & 0 deletions eng/scripts/spell-check-public-api.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
param(
$ServiceDirectory = '',
$RelativePackagePath = ''
)

if ($ServiceDirectory -and $RelativePackagePath) {
throw "Cannot specify both ServiceDirectory and RelativePackagePath parameters."
}

Set-StrictMode -Version 3.0
."$PSScriptRoot/../common/scripts/common.ps1"

$files = @()
if ($ServiceDirectory) {
$files = Get-ChildItem -Path "$PSScriptRoot/../../sdk/$ServiceDirectory/*/api/*.cs" -File
} elseif ($RelativePackagePath) {
$files = Get-ChildItem -Path "$PSScriptRoot/../../sdk/$RelativePackagePath/api/*.cs" -File
} else {
$files = Get-ChildItem -Path "$PSScriptRoot/../../sdk/*/*/api/*.cs" -File
}

Write-Host "Found $($files.Count) public API surface files to spell check."
."$PSScriptRoot/../common/spelling/Invoke-Cspell.ps1" `
-CSpellConfigPath "./.vscode/cspell.json" `
-FileList $files.FullName
6 changes: 6 additions & 0 deletions sdk/recoveryservices/cspell.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import:
- ../../.vscode/cspell.json
overrides:
- filename: '**/sdk/recoveryservices/**'
words:
- bcdr