Skip to content

Commit d033d4e

Browse files
authored
Add cspell (#3011)
1 parent 16efde4 commit d033d4e

File tree

70 files changed

+1123
-129
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+1123
-129
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
changeKind: fix
3+
packages:
4+
- "@autorest/python"
5+
- "@azure-tools/typespec-python"
6+
---
7+
8+
Fix spelling mistakes by running cspell in pipelines

cspell.yaml

Lines changed: 165 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,165 @@
1+
version: "0.2"
2+
language: en
3+
allowCompoundWords: true
4+
dictionaries:
5+
- node
6+
- typescript
7+
- python
8+
words:
9+
- aiohttp
10+
- apim
11+
- arrayofresources
12+
- autorest
13+
- azsdk
14+
- azuresdk
15+
- buongiorno
16+
- byversion
17+
- cadl
18+
- clientenumversiontolerant
19+
- codegen
20+
- collisons
21+
- combinedtype
22+
- commitish
23+
- contoso
24+
- corehttp
25+
- ctxt
26+
- deduplicator
27+
- dictionaryofresources
28+
- dotenv
29+
- dpgcustomizationcustomizedversiontolerant
30+
- dpgcustomizationinitialversiontolerant
31+
- dpgservicedriveninitialversiontolerant
32+
- dpgservicedrivenupdateoneversiontolerant
33+
- dpgtestmodelsversiontolerant
34+
- eastus
35+
- enumdiscriminator
36+
- espt
37+
- extensibleenumsswagger
38+
- extensibleenumsswaggerversiontolerant
39+
- fspath
40+
- getpgid
41+
- giacamo
42+
- hdvcmxk
43+
- hira
44+
- headasbooleanfalse
45+
- headasbooleantrue
46+
- innie
47+
- iohttp
48+
- iswild
49+
- ivar
50+
- killpg
51+
- kwarg
52+
- levelno
53+
- linuxnextvmimage
54+
- linuxos
55+
- linuxvmimage
56+
- lmazuel
57+
- lropaging
58+
- lropagingversiontolerant
59+
- lros
60+
- lrosads
61+
- lroversiontolerant
62+
- lrowithparameterizedendpoints
63+
- lrowithparameterizedendpointsversiontolerant
64+
- macvmimage
65+
- mday
66+
- mergepatchjsonversiontolerant
67+
- mgmt
68+
- mgmtplane
69+
- mros
70+
- mspaint
71+
- msrc
72+
- multiapi
73+
- multiapiclient
74+
- multiapinoasync
75+
- multiapisecurity
76+
- mutli
77+
- myenv
78+
- myoption
79+
- mypythonfile
80+
- myuser
81+
- nexted
82+
- nihao
83+
- noprop
84+
- nspkg
85+
- nonstringenums
86+
- nonstringenumsversiontolerant
87+
- nooperations
88+
- nopolling
89+
- npmjs
90+
- odata
91+
- overriden
92+
- psscriptanalyzer
93+
- ptvsd
94+
- pylint
95+
- pylintrc
96+
- pygen
97+
- qnas
98+
- ragrs
99+
- rcfile
100+
- recommonmark
101+
- reqs
102+
- retrys
103+
- roundtrippable
104+
- rscc
105+
- rscd
106+
- rsce
107+
- rscl
108+
- rsct
109+
- rtype
110+
- sads
111+
- scooby
112+
- sdkcore
113+
- securityaadswagger
114+
- securityaadswaggercredentialflag
115+
- securityaadswaggerversiontolerant
116+
- siameeee
117+
- spheredpg
118+
- subclient
119+
- subnamespace
120+
- subscriptionidapiversion
121+
- subscriptionidapiversionversiontolerant
122+
- tcgc
123+
- tfft
124+
- tikka
125+
- toctree
126+
- undoc
127+
- venv
128+
- venvtools
129+
- wday
130+
- westus
131+
- windowsvmimage
132+
- xmsclientrequestid
133+
- xmserrorresponse
134+
- xmserrorresponseversiontolerant
135+
- yankovic
136+
- zval
137+
ignorePaths:
138+
- "**/node_modules/**"
139+
- "**/dist/**"
140+
- "**/coverage/**"
141+
- "**/__pycache__/**"
142+
- pnpm-lock.yaml
143+
- .git/**
144+
- .gitignore
145+
- .vscode/**
146+
- .github/CODEOWNERS
147+
- "**/Expected/AcceptanceTests/**"
148+
- "**/generated/**"
149+
- "**/CHANGELOG.md"
150+
- .prettierignore
151+
- "**/.github/**"
152+
153+
useGitignore: true
154+
enableGlobDot: true
155+
enableFiletypes:
156+
- cadl
157+
patterns:
158+
- name: cursortest
159+
pattern: /(.*)┆(.*)/g
160+
- name: Authorization_Basic
161+
description: Ignore Base64 authorization tokens
162+
pattern: "/Authorization: Basic\\s+\\S+/g"
163+
ignoreRegExpList:
164+
- cursortest
165+
- Authorization_Basic

docs/client/models.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ snippet
99
from azure.pets.models import Dog
1010
```
1111

12-
Enums are also listed in the `models` namespace, so say you have enum class `DogTypes`. To access the `DALMATION` enum, your code would look like
12+
Enums are also listed in the `models` namespace, so say you have enum class `DogTypes`. To access the `DALMATIAN` enum, your code would look like
1313

1414
```
1515
from azure.pets.models import DogTypes
1616
17-
my_dog_type = DogTypes.DALMATION
17+
my_dog_type = DogTypes.DALMATIAN
1818
```
1919

2020
## Multi API

eng/pipelines/ci-template.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,10 @@ steps:
7272
displayName: List installed packages
7373
workingDirectory: $(Build.SourcesDirectory)/autorest.python/packages/${{parameters.folderName}}
7474

75+
- script: pnpm run cspell
76+
displayName: Cspell
77+
workingDirectory: $(Build.SourcesDirectory)/autorest.python/
78+
7579
- script: pnpm run lint --command eslint --skipWarning ${{ parameters.skipWarning }}
7680
displayName: Eslint
7781
workingDirectory: $(Build.SourcesDirectory)/autorest.python/packages/${{parameters.folderName}}

eng/scripts/initialize.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def main(update_to_latest_typespec: bool, build_artifacts_path: Path) -> None:
3232
# copy package.json and pnpm-lock.yaml from build artifacts
3333
lock_files_dir = Path(build_artifacts_path) / "lock-files"
3434
if lock_files_dir.exists():
35-
print(f"Copying package.json and pnmp-lock.yaml from {lock_files_dir}")
35+
print(f"Copying package.json and pnpm-lock.yaml from {lock_files_dir}")
3636
copy(lock_files_dir / "package.json", root_dir)
3737
copy(lock_files_dir / "pnpm-lock.yaml", root_dir)
3838
copy(

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"clean": "pnpm -r run clean",
1515
"lint": "pnpm -r run lint",
1616
"format": "npx prettier **/*.ts --write",
17+
"cspell": "cspell --no-progress .",
1718
"check-format": "npx prettier **/*.ts --check --end-of-line auto",
1819
"check-version-mismatch": "syncpack list-mismatches --types prod,peer",
1920
"fix-version-mismatch": "syncpack fix-mismatches",
@@ -42,7 +43,8 @@
4243
"prettier": "~3.3.3",
4344
"syncpack": "^13.0.0",
4445
"typescript": "~5.6.2",
45-
"typescript-eslint": "^8.7.0"
46+
"typescript-eslint": "^8.7.0",
47+
"cspell": "^7.0.0"
4648
},
4749
"syncpack": {
4850
"dependencyTypes": [

packages/autorest.python/autorest/codegen.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,15 @@ def __init__(
4040
class CodeGeneratorAutorest(CodeGenerator, PluginAutorest):
4141
def get_options(self) -> Dict[str, Any]:
4242
if self._autorestapi.get_boolean_value("python3-only") is False:
43-
_LOGGER.warning("You have passed in --python3-only=False. We have force overriden this to True.")
43+
_LOGGER.warning("You have passed in --python3-only=False. We have force overridden this to True.")
4444
if self._autorestapi.get_boolean_value("add-python3-operation-files"):
4545
_LOGGER.warning(
4646
"You have passed in --add-python3-operation-files. "
4747
"This flag no longer has an effect bc all SDKs are now Python3 only."
4848
)
4949
if self._autorestapi.get_boolean_value("reformat-next-link"):
5050
_LOGGER.warning(
51-
"You have passed in --reformat-next-link. We have force overriden "
51+
"You have passed in --reformat-next-link. We have force overridden "
5252
"this to False because we no longer reformat initial query parameters into next "
5353
"calls unless explicitly defined in the service definition."
5454
)

packages/autorest.python/autorest/jsonrpc/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313

1414
class Channel(Enum):
15-
# Information is considered the mildest of responses; not necesarily actionable.
15+
# Information is considered the mildest of responses; not necessarily actionable.
1616
Information = "information"
1717

1818
# Warnings are considered important for best practices, but not catastrophic in nature.
@@ -27,7 +27,7 @@ class Channel(Enum):
2727
# Verbose messages give the user additional clarity on the process.
2828
Verbose = "verbose"
2929

30-
# Catastrophic failure, likely abending the process.
30+
# Catastrophic failure, likely ending the process.
3131
Fatal = "fatal"
3232

3333

packages/autorest.python/autorest/m4reformatter/__init__.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,7 @@ def _update_operation_helper(
492492
*,
493493
is_overload: bool = False,
494494
) -> Dict[str, Any]:
495-
in_overriden = body_parameter["type"]["type"] == "combined" if body_parameter else False
495+
in_overridden = body_parameter["type"]["type"] == "combined" if body_parameter else False
496496
abstract = False
497497
if body_parameter and (body_parameter.get("entries") or len(body_parameter["type"].get("types", [])) > 2):
498498
# this means it's formdata or urlencoded, or there are more than 2 types of body
@@ -507,7 +507,7 @@ def _update_operation_helper(
507507
yaml_data,
508508
body_parameter,
509509
in_overload=is_overload,
510-
in_overriden=in_overriden,
510+
in_overridden=in_overridden,
511511
),
512512
"bodyParameter": body_parameter,
513513
"responses": [update_response(r) for r in yaml_data.get("responses", [])],
@@ -723,7 +723,7 @@ def _update_content_type_parameter(
723723
request_media_types: List[str],
724724
*,
725725
in_overload: bool = False,
726-
in_overriden: bool = False,
726+
in_overridden: bool = False,
727727
) -> Dict[str, Any]:
728728
# override content type type to string
729729
if not body_parameter:
@@ -737,14 +737,14 @@ def _update_content_type_parameter(
737737
description = param["language"]["default"]["description"]
738738
if description and description[-1] != ".":
739739
description += "."
740-
if not (in_overriden or in_overload):
740+
if not (in_overridden or in_overload):
741741
param["inDocstring"] = False
742742
elif in_overload:
743743
description += " Content type parameter for " f"{get_body_type_for_description(body_parameter)} body."
744744
if not in_overload or (body_parameter["type"]["type"] == "binary" and len(request_media_types) > 1):
745745
content_types = "'" + "', '".join(request_media_types) + "'"
746746
description += f" Known values are: {content_types}."
747-
if not in_overload and not in_overriden:
747+
if not in_overload and not in_overridden:
748748
param["clientDefaultValue"] = body_parameter["defaultContentType"]
749749
param["language"]["default"]["description"] = description
750750
return param
@@ -758,7 +758,7 @@ def _update_parameters_helper(
758758
request_media_types: List[str],
759759
*,
760760
in_overload: bool = False,
761-
in_overriden: bool = False,
761+
in_overridden: bool = False,
762762
) -> List[Dict[str, Any]]:
763763
retval: List[Dict[str, Any]] = []
764764
has_flattened_body = body_parameter and body_parameter.get("flattened")
@@ -785,9 +785,9 @@ def _update_parameters_helper(
785785
body_parameter,
786786
request_media_types,
787787
in_overload=in_overload,
788-
in_overriden=in_overriden,
788+
in_overridden=in_overridden,
789789
)
790-
updated_param = self.update_parameter(param, in_overload=in_overload, in_overriden=in_overriden)
790+
updated_param = self.update_parameter(param, in_overload=in_overload, in_overridden=in_overridden)
791791
retval.append(updated_param)
792792
return retval
793793

@@ -797,7 +797,7 @@ def update_parameters(
797797
body_parameter: Optional[Dict[str, Any]],
798798
*,
799799
in_overload: bool = False,
800-
in_overriden: bool = False,
800+
in_overridden: bool = False,
801801
) -> List[Dict[str, Any]]:
802802
retval: List[Dict[str, Any]] = []
803803
seen_client_names: Set[str] = set()
@@ -812,7 +812,7 @@ def update_parameters(
812812
groupers,
813813
request_media_types,
814814
in_overload=in_overload,
815-
in_overriden=in_overriden,
815+
in_overridden=in_overridden,
816816
)
817817
)
818818
# now we handle content type and accept headers.
@@ -831,7 +831,7 @@ def update_parameters(
831831
groupers,
832832
request_media_types,
833833
in_overload=in_overload,
834-
in_overriden=in_overriden,
834+
in_overridden=in_overridden,
835835
)
836836
)
837837
all_params = (retval + [body_parameter]) if body_parameter else retval
@@ -853,7 +853,7 @@ def update_parameter(
853853
*,
854854
override_client_name: Optional[str] = None,
855855
in_overload: bool = False,
856-
in_overriden: bool = False,
856+
in_overridden: bool = False,
857857
) -> Dict[str, Any]:
858858
param_base = self.update_parameter_base(yaml_data, override_client_name=override_client_name)
859859
type = get_type(yaml_data["schema"])
@@ -869,7 +869,7 @@ def update_parameter(
869869
"inOverload": in_overload,
870870
"skipUrlEncoding": yaml_data.get("extensions", {}).get("x-ms-skip-url-encoding", False),
871871
"inDocstring": yaml_data.get("inDocstring", True),
872-
"inOverriden": in_overriden,
872+
"inOverridden": in_overridden,
873873
"delimiter": update_parameter_delimiter(protocol_http.get("style")),
874874
}
875875
)

packages/autorest.python/autorest/multiapi/templates/multiapi_service_client.py.jinja2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def __init__(
3333

3434
class _SDKClient(object):
3535
def __init__(self, *args, **kwargs):
36-
"""This is a fake class to support current implemetation of MultiApiClientMixin."
36+
"""This is a fake class to support current implementation of MultiApiClientMixin."
3737
Will be removed in final version of multiapi azure-core based client
3838
"""
3939
pass

0 commit comments

Comments
 (0)