Skip to content

Commit

Permalink
New cspell baseline + SpellCheck - All workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
danieljurek committed Jan 10, 2025
1 parent 2718ebc commit 12e6b38
Show file tree
Hide file tree
Showing 282 changed files with 9,187 additions and 33 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/spelling-all.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: SpellCheck - All

on:
push:
branches:
- main
- RPSaaSMaster

schedule:
# Run every day at 12:06 UTC
- cron: "6 12 * * *"
workflow_dispatch:

jobs:
spellcheck:
name: SpellCheck
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 1

- name: Run spelling check
run: |
./eng/common/spelling/Invoke-Cspell.ps1 `
-ScanGlobs 'specification/**' `
-CSpellConfigPath './cspell.json'
shell: pwsh
2 changes: 1 addition & 1 deletion .github/workflows/spelling.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Run spelling check
run: |
./eng/common/scripts/check-spelling-in-changed-files.ps1 `
-CSpellConfigPath 'cSpell.json' `
-CSpellConfigPath 'cspell.json' `
-SourceCommittish HEAD `
-TargetCommittish HEAD^ `
-ExitWithError
Expand Down
7 changes: 7 additions & 0 deletions cspell.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"//purpose": "This file is needed for older spell check versions to specify the files to lint",
"version": "0.2",
"import": [
"cspell.yaml"
]
}
54 changes: 51 additions & 3 deletions cspell.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
version: "0.2"
version: '0.2'
language: en
words: []
flagWords:
- teh
ignorePaths:
- '**/examples/**'
- '**/package-lock.json'
- cSpell.json
- cspell.json
- eng/**
- node_modules/**
ignoreRegExpList:
Expand All @@ -29,3 +28,52 @@ enableFiletypes:
- cadl
ignoreWords:
- trafficcontrollerspec
words:
- autorest
- autoscale
- azext
- byos
- cadl
- codegen
- contoso
- datacenter
- dataplane
- deallocate
- deallocated
- eastus
- entra
- fqdns
- hana
- innererror
- keyvault
- kusto
- liftr
- localizable
- managedidentity
- maxpagesize
- mbps
- mgmt
- modelerfour
- multiapi
- multiapiscript
- odata
- onboarded
- payg
- privatelinks
- privatepreview
- providerhub
- regen
- resourcegroups
- resourcemanager
- rpaas
- rulesets
- skiptoken
- skus
- somefile
- subresource
- substatus
- typespec
- upsert
- vmss
- vnet
- westus
57 changes: 28 additions & 29 deletions documentation/ci-fix.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ If you need help with your specs PR, please first thoroughly read the [aka.ms/az
- [`Swagger PrettierCheck`](#swagger-prettiercheck)
- [Prettier reference](#prettier-reference)
- [`Swagger SemanticValidation`](#swagger-semanticvalidation)
- [`Swagger SpellCheck`](#swagger-spellcheck)
- [`Spell Check`](#spell-check)
- [`TypeSpec Validation`](#typespec-validation)
- [Run `tsv` locally](#run-tsv-locally)
- [`license/cla`](#licensecla)
Expand Down Expand Up @@ -113,7 +113,7 @@ Various APIViews are generated as part of the Azure REST API specs PR build. Amo
### If an expected APIView was not generated, follow the step below to troubleshoot.

- On the CI check click on `details` > `View Azure DevOps build log for more details` to view the devOps logs.
- Investigate the CI job for the languge with error. TypeSpec and Swagger APIViews are generated as part of the `AzureRestApiSpecsPipeline` stage in the `TypeSpecAPIView` and `SwaggerAPIView` jobs respectively, while APIViews for other SDK languges are generated in their respective language jobs in the `SDK Automation` stage.
- Investigate the CI job for the language with error. TypeSpec and Swagger APIViews are generated as part of the `AzureRestApiSpecsPipeline` stage in the `TypeSpecAPIView` and `SwaggerAPIView` jobs respectively, while APIViews for other SDK languages are generated in their respective language jobs in the `SDK Automation` stage.
- Ensure that all previous checks in the job are green before proceeding.

### Diagnosing APIView failure for SDK Language (not Swagger or TypeSpec)
Expand Down Expand Up @@ -247,35 +247,34 @@ oav validate-spec <openapi-spec-path>
Please see [readme](https://github.com/Azure/oav/blob/bd04e228b4181c53769ed88e561dec5212e77253/README.md) for how to install or run tool in details.
Refer to [Semantic and Model Violations Reference](https://github.com/Azure/azure-rest-api-specs/blob/main/documentation/Semantic-and-Model-Violations-Reference.md) for detailed description of validations and how-to-fix guidance.

## `Swagger SpellCheck`

If you receive a spelling failure either fix the spelling to match or if there are words that need to be suppressed for your service then add the word to the override list in [cspell.json](https://github.com/Azure/azure-rest-api-specs/blob/main/cSpell.json). Either
add to your existing section or create a new section for your specific spec or service family if the work is more generally used in lots of files under your service.

``` yaml
"overrides": [
... example of specific file override
{
"filename": "**/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2015-03-01-preview/cluster.json",
"words": [
"saskey"
]
}
... example of specific service family override
{
"filename": "**/specification/cognitiveservices/**/*.json",
"words": [
"flac",
"mpga"
]
}
## Spell Check

If you receive a spelling failure either fix the spelling in source. If there are words that need to be suppressed for
your service, add the word to the override list in the `words` list in the `specification/<service>/cspell.json`
file for your service.

If the `specification/<service>/cspell.json` file does not exist, create it using the example below and set the `words`
list to the words that need to be suppressed. Both `version` and `import` fields are required, use the values in the
example.

For example (note the words list is sorted alphabetically):

```json
{
"version": "0.2",
"import": [
"../../cspell.json"
],
"words": [
"aardvark",
"zoology"
]
}
```

Words are case-insensitive so use lower case for the word list.
Words are case-insensitive so you only need to add the word once.

If you need more information on see [cspell configuration](https://cspell.org/configuration/).

*Note*: We are trying to move away from one shared dictionary file so try and avoid editing custom-words.txt in the root as it will likely go away in the future.
For more information see [cspell configuration](https://cspell.org/configuration/).

## `TypeSpec Validation`

Expand Down Expand Up @@ -313,4 +312,4 @@ Following checks have been removed from the validation toolchain as of August 20
[APIView Support Teams Channel]: https://teams.microsoft.com/l/channel/19%3A3adeba4aa1164f1c889e148b1b3e3ddd%40thread.skype/APIView?groupId=3e17dcb0-4257-4a30-b843-77f47f1d4121&tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47
[automated validation tooling]: https://eng.ms/docs/products/azure-developer-experience/design/api-specs/api-tooling
[Azure REST API specs PR]: https://eng.ms/docs/products/azure-developer-experience/design/api-specs-pr/api-specs-pr
[TypeSpec Discussions Teams channel]: https://teams.microsoft.com/l/channel/19%3A906c1efbbec54dc8949ac736633e6bdf%40thread.skype/TypeSpec%20Discussion%20%F0%9F%90%AE?groupId=3e17dcb0-4257-4a30-b843-77f47f1d4121&tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47
[TypeSpec Discussions Teams channel]: https://teams.microsoft.com/l/channel/19%3A906c1efbbec54dc8949ac736633e6bdf%40thread.skype/TypeSpec%20Discussion%20%F0%9F%90%AE?groupId=3e17dcb0-4257-4a30-b843-77f47f1d4121&tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47
12 changes: 12 additions & 0 deletions specification/EnterpriseKnowledgeGraph/cspell.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# This file configures spell checking. Items in "words" were initially populated
# with words that might be spelling errors. Review these words and take
# appropriate action. For more information, see: https://aka.ms/ci-fix#spell-check

# Spell checking is not case sensitive
# Keep word lists in alphabetical so the file is easier to manage
version: '0.2'
import:
- ../../cspell.yaml
words:
- enterpriseknowledgegraphservice

12 changes: 12 additions & 0 deletions specification/addons/cspell.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# This file configures spell checking. Items in "words" were initially populated
# with words that might be spelling errors. Review these words and take
# appropriate action. For more information, see: https://aka.ms/ci-fix#spell-check

# Spell checking is not case sensitive
# Keep word lists in alphabetical so the file is easier to manage
version: '0.2'
import:
- ../../cspell.yaml
words:
- armaddons

55 changes: 55 additions & 0 deletions specification/adhybridhealthservice/cspell.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# This file configures spell checking. Items in "words" were initially populated
# with words that might be spelling errors. Review these words and take
# appropriate action. For more information, see: https://aka.ms/ci-fix#spell-check

# Spell checking is not case sensitive
# Keep word lists in alphabetical so the file is easier to manage
version: '0.2'
import:
- ../../cspell.yaml
words:
- addomain
- addomainservicemembers
- addsservicemembers
- addsservices
- adfs
- adhybridhealthservice
- alertfeedback
- availibility
- badpassword
- continuationtoken
- datafreshness
- exporterrors
- exportstatus
- extranet
- feedbacktype
- forestsummary
- globalconfiguration
- hotfixes
- metricmetadata
- modififed
- monitoringconfiguration
- monitoringconfigurations
- mpping
- multivalued
- occured
- onboards
- onpremises
- qfes
- replicationdetails
- replicationstatus
- replicationsummary
- serviceconfiguration
- servicemembers
- sysvol
- userpreference
overrides:
- filename: >-
**/specification/adhybridhealthservice/resource-manager/Microsoft.ADHybridHealthService/stable/2014-01-01/ADHybridHealthService.json
words:
- addomain
- availibility
- modififed
- mpping
- occured
14 changes: 14 additions & 0 deletions specification/advisor/cspell.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# This file configures spell checking. Items in "words" were initially populated
# with words that might be spelling errors. Review these words and take
# appropriate action. For more information, see: https://aka.ms/ci-fix#spell-check

# Spell checking is not case sensitive
# Keep word lists in alphabetical so the file is easier to manage
version: '0.2'
import:
- ../../cspell.yaml
words:
- armadvisor
- asssignment
- unlocalized

28 changes: 28 additions & 0 deletions specification/agrifood/cspell.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# This file configures spell checking. Items in "words" were initially populated
# with words that might be spelling errors. Review these words and take
# appropriate action. For more information, see: https://aka.ms/ci-fix#spell-check

# Spell checking is not case sensitive
# Keep word lists in alphabetical so the file is easier to manage
version: '0.2'
import:
- ../../cspell.yaml
words:
- adma
- agfood
- agri
- agrifood
- dailyforecast
- dailyhistorical
- discoverability
- farmbeats
- johndeere
- madma
- ndvi
- ndwi
- retryable
- shapefile
- shapefiles
- sinergise
- stac

Loading

0 comments on commit 12e6b38

Please sign in to comment.