Skip to content

Commit

Permalink
Public API spell check (#23150)
Browse files Browse the repository at this point in the history
* Make public API spell checking opt-out, opt out services which have errors

* Opt eventhub in

* Those with SpellCheckPublichApiSurface: true are already opted-in; remove. Opt out agrifood which has some false positives.

* re-add service directory

* Opt core out

* Add personalizer and identity false positive exceptions and remove from the opt-out list

* Add use of `--no-must-find-files` to usages of npx. This is not strictly necessary in aggregate-reports.yml, in that case it is meant to make invocation of cspell consistent

* Opt out of public API surface spell checking

* Update config: Opt out via cspell.json instead of ci.yml; Add 'dont' to the list of words so Core has zero spelling errors

* Remove opt out from ci.yml

* Remove SpellCheckPublicApiSurface parameter from ci.yml files, opt-out is handled in cspell.json

* Use more restrictive globbing pattern in aggregate-reports.yml for spell checking. The previous pattern was including tests folders unnecessarily
  • Loading branch information
danieljurek authored Aug 18, 2021
1 parent 1368281 commit 3d9ee7a
Show file tree
Hide file tree
Showing 9 changed files with 33 additions and 19 deletions.
30 changes: 28 additions & 2 deletions .vscode/cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,29 @@
"*.log",
"*.sln",
"*.user",
".vscode/cspell.json"
".vscode/cspell.json",

// These services are opted out of public API surface spell checking.
// Spelling issues must be addressed before adding these back in.
"sdk/agrifood/*/api/*.cs",
"sdk/communication/*/api/*.cs",
"sdk/compute/*/api/*.cs",
"sdk/containerregistry/*/api/*.cs",
"sdk/cosmosdb/*/api/*.cs",
"sdk/digitaltwins/*/api/*.cs",
"sdk/dns/*/api/*.cs",
"sdk/eventgrid/*/api/*.cs",
"sdk/insights/*/api/*.cs",
"sdk/machinelearningservices/*/api/*.cs",
"sdk/modelsrepository/*/api/*.cs",
"sdk/monitor/*/api/*.cs",
"sdk/network/*/api/*.cs",
"sdk/objectanchors/*/api/*.cs",
"sdk/purview/*/api/*.cs",
"sdk/remoterendering/*/api/*.cs",
"sdk/sqlmanagement/*/api/*.cs",
"sdk/synapse/*/api/*.cs",
"sdk/videoanalyzer/*/api/*.cs"
],
// cspell is not case sensitive
// Sort words alphabetically to make this list easier to use
Expand All @@ -38,6 +60,7 @@
"deserializable",
"deserializes",
"diagnoser",
"dont",
"dtmf",
"epsg",
"expando",
Expand All @@ -63,7 +86,10 @@
"unhold",
"uninstrumented",
"westus",
"xunit"
"xunit",
"vnet",
"unencrypted",
"personalizer"
],
"overrides": [
{
Expand Down
8 changes: 3 additions & 5 deletions eng/pipelines/aggregate-reports.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,12 @@ jobs:
- pwsh: |
npx cspell lint `
--config ./.vscode/cspell.json `
./sdk/**/api/*.cs
--no-must-find-files `
'sdk/*/*/api/*.cs'
displayName: Check spelling of public API surface
# Spelling errors in public api surface are not blockers yet but will
# Spelling errors in public api surface are not blockers yet but will
# become blockers when this is rolled out to all services. For now, turn
# the pipeline yellow if spelling errors are detected but do not block.
# Individual services can be blocked on spelling errors using:
# `SpellCheckPublicApiSurface: true`
# in the archetype-sdk-client.yml template invocation
continueOnError: true
- template: /eng/common/pipelines/templates/steps/verify-links.yml
Expand Down
5 changes: 1 addition & 4 deletions eng/pipelines/templates/jobs/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@ parameters:
- name: MatrixReplace
type: object
default: []
- name: SpellCheckPublicApiSurface
type: boolean
default: false

jobs:
- job: Build
Expand Down Expand Up @@ -140,7 +137,7 @@ jobs:
arguments: >
-ServiceDirectory ${{ parameters.ServiceToTest }}
-SDKType ${{ parameters.SDKType }}
-SpellCheckPublicApiSurface:$${{ parameters.SpellCheckPublicApiSurface }}
-SpellCheckPublicApiSurface
pwsh: true
failOnStderr: false
- task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0
Expand Down
4 changes: 0 additions & 4 deletions eng/pipelines/templates/stages/archetype-sdk-client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,6 @@ parameters:
- name: MatrixReplace
type: object
default: []
- name: SpellCheckPublicApiSurface
type: boolean
default: false

variables:
- template: ../variables/globals.yml
Expand All @@ -74,7 +71,6 @@ stages:
ArtifactName: packages
TestSetupSteps: ${{ parameters.TestSetupSteps }}
TestTimeoutInMinutes: ${{ parameters.TestTimeoutInMinutes }}
SpellCheckPublicApiSurface: ${{ parameters.SpellCheckPublicApiSurface }}
MatrixConfigs:
- ${{ each config in parameters.MatrixConfigs }}:
- ${{ config }}
Expand Down
1 change: 1 addition & 0 deletions eng/scripts/Export-API.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ if ($SpellCheckPublicApiSurface) {
Write-Host "Spell check public API surface"
npx cspell lint `
--config "$PSScriptRoot/../../.vscode/cspell.json" `
--no-must-find-files `
"$PSScriptRoot/../../sdk/$ServiceDirectory/*/api/*.cs"
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"
Expand Down
1 change: 0 additions & 1 deletion sdk/formrecognizer/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ extends:
template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml
parameters:
ServiceDirectory: formrecognizer
SpellCheckPublicApiSurface: true
ArtifactName: packages
Artifacts:
- name: Azure.AI.FormRecognizer
Expand Down
1 change: 0 additions & 1 deletion sdk/storage/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ extends:
template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml
parameters:
ServiceDirectory: storage
SpellCheckPublicApiSurface: true
ArtifactName: packages
Artifacts:
- name: Azure.Storage.Blobs
Expand Down
1 change: 0 additions & 1 deletion sdk/textanalytics/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ extends:
template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml
parameters:
ServiceDirectory: textanalytics
SpellCheckPublicApiSurface: true
ArtifactName: packages
Artifacts:
- name: Azure.AI.TextAnalytics
Expand Down
1 change: 0 additions & 1 deletion sdk/translation/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ extends:
parameters:
ServiceDirectory: translation
ArtifactName: packages
SpellCheckPublicApiSurface: true
Artifacts:
- name: Azure.AI.Translation.Document
safeName: AzureAITranslationDocument

0 comments on commit 3d9ee7a

Please sign in to comment.