Skip to content

Commit 77e09da

Browse files
authored
chore: add basic spell checking as a pre-commit hook (#2654)
1 parent d1ed829 commit 77e09da

17 files changed

Lines changed: 34 additions & 28 deletions

File tree

.pre-commit-config.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,9 @@ repos:
6565
- --quiet # otherwise prints all checked files that are ok...
6666
- --skip-checking-raises=true
6767
- --check-class-attributes=false
68+
69+
- repo: https://github.com/codespell-project/codespell
70+
rev: v2.4.1
71+
hooks:
72+
- id: codespell
73+
files: ^cognite/.*

cognite/client/_api/annotations.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ async def reverse_lookup(
196196
197197
Examples:
198198
199-
Retrieve the first 100 ids of annotated resources mathing the 'file' resource type:
199+
Retrieve the first 100 ids of annotated resources matching the 'file' resource type:
200200
201201
>>> from cognite.client import CogniteClient
202202
>>> from cognite.client.data_classes import AnnotationReverseLookupFilter

cognite/client/_api/data_modeling/containers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ async def apply(self, container: ContainerApply | Sequence[ContainerApply]) -> C
415415
... "prop21": ContainerPropertyApply(Json(is_list=True)),
416416
... "prop22": ContainerPropertyApply(SequenceReference),
417417
... "prop23": ContainerPropertyApply(SequenceReference(is_list=True)),
418-
... # Note: It is adviced to represent files and time series directly as nodes
418+
... # Note: It is advised to represent files and time series directly as nodes
419419
... # instead of referencing existing:
420420
... "prop24": ContainerPropertyApply(FileReference),
421421
... "prop25": ContainerPropertyApply(FileReference(is_list=True)),

cognite/client/_api/events.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ async def __call__(
120120
type (str | None): Type of the event, e.g 'failure'.
121121
subtype (str | None): Subtype of the event, e.g 'electrical'.
122122
metadata (dict[str, str] | None): Customizable extra data about the event. String key -> String value.
123-
asset_ids (Sequence[int] | None): Asset IDs of related equipments that this event relates to.
123+
asset_ids (Sequence[int] | None): Asset IDs of related equipment that this event relates to.
124124
asset_external_ids (SequenceNotStr[str] | None): Asset External IDs of related equipment that this event relates to.
125125
asset_subtree_ids (int | Sequence[int] | None): Only include events that have a related asset in a subtree rooted at any of these assetIds. If the total size of the given subtrees exceeds 100,000 assets, an error will be returned.
126126
asset_subtree_external_ids (str | SequenceNotStr[str] | None): Only include events that have a related asset in a subtree rooted at any of these assetExternalIds. If the total size of the given subtrees exceeds 100,000 assets, an error will be returned.
@@ -689,7 +689,7 @@ async def list(
689689
type (str | None): Type of the event, e.g 'failure'.
690690
subtype (str | None): Subtype of the event, e.g 'electrical'.
691691
metadata (dict[str, str] | None): Customizable extra data about the event. String key -> String value.
692-
asset_ids (Sequence[int] | None): Asset IDs of related equipments that this event relates to.
692+
asset_ids (Sequence[int] | None): Asset IDs of related equipment that this event relates to.
693693
asset_external_ids (SequenceNotStr[str] | None): Asset External IDs of related equipment that this event relates to.
694694
asset_subtree_ids (int | Sequence[int] | None): Only include events that have a related asset in a subtree rooted at any of these assetIds. If the total size of the given subtrees exceeds 100,000 assets, an error will be returned.
695695
asset_subtree_external_ids (str | SequenceNotStr[str] | None): Only include events that have a related asset in a subtree rooted at any of these assetExternalIds. If the total size of the given subtrees exceeds 100,000 assets, an error will be returned.

cognite/client/_api/hosted_extractors/jobs.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ async def list_logs(
287287
288288
Examples:
289289
290-
Reqests logs for a specific job:
290+
Requests logs for a specific job:
291291
292292
>>> from cognite.client import CogniteClient, AsyncCogniteClient
293293
>>> client = CogniteClient()
@@ -333,7 +333,7 @@ async def list_metrics(
333333
334334
Examples:
335335
336-
Reqests metrics for a specific job:
336+
Requests metrics for a specific job:
337337
338338
>>> from cognite.client import CogniteClient, AsyncCogniteClient
339339
>>> client = CogniteClient()

cognite/client/_api/iam/groups.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ async def create(self, group: Group | GroupWrite | Sequence[Group] | Sequence[Gr
125125
... members=ALL_USER_ACCOUNTS,
126126
... )
127127
>>> user_list_group = GroupWrite(
128-
... name="Specfic users only",
128+
... name="Specific users only",
129129
... capabilities=my_capabilities,
130130
... members=["XRsSD1k3mTIKG", "M0SxY6bM9Jl"],
131131
... )

cognite/client/_api/units.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,14 @@ async def retrieve(
6262
6363
Examples:
6464
65-
Retrive unit 'temperature:deg_c':
65+
Retrieve unit 'temperature:deg_c':
6666
6767
>>> from cognite.client import CogniteClient, AsyncCogniteClient
6868
>>> client = CogniteClient()
6969
>>> # async_client = AsyncCogniteClient() # another option
7070
>>> res = client.units.retrieve("temperature:deg_c")
7171
72-
Retrive units 'temperature:deg_c' and 'pressure:bar':
72+
Retrieve units 'temperature:deg_c' and 'pressure:bar':
7373
7474
>>> res = client.units.retrieve(["temperature:deg_c", "pressure:bar"])
7575

cognite/client/_sync_api/annotations.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""
22
===============================================================================
3-
dfae0e191c572120b16241f21bc24a54
3+
0393af121436eccd196921625498ee8b
44
This file is auto-generated from the Async API modules, - do not edit manually!
55
===============================================================================
66
"""
@@ -148,7 +148,7 @@ def reverse_lookup(self, filter: AnnotationReverseLookupFilter, limit: int | Non
148148
149149
Examples:
150150
151-
Retrieve the first 100 ids of annotated resources mathing the 'file' resource type:
151+
Retrieve the first 100 ids of annotated resources matching the 'file' resource type:
152152
153153
>>> from cognite.client import CogniteClient
154154
>>> from cognite.client.data_classes import AnnotationReverseLookupFilter

cognite/client/_sync_api/data_modeling/containers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""
22
===============================================================================
3-
fa523a777c9b728e0712f75d938fbb0c
3+
26c89a64a49ece12d8f69199724157f0
44
This file is auto-generated from the Async API modules, - do not edit manually!
55
===============================================================================
66
"""
@@ -366,7 +366,7 @@ def apply(self, container: ContainerApply | Sequence[ContainerApply]) -> Contain
366366
... "prop21": ContainerPropertyApply(Json(is_list=True)),
367367
... "prop22": ContainerPropertyApply(SequenceReference),
368368
... "prop23": ContainerPropertyApply(SequenceReference(is_list=True)),
369-
... # Note: It is adviced to represent files and time series directly as nodes
369+
... # Note: It is advised to represent files and time series directly as nodes
370370
... # instead of referencing existing:
371371
... "prop24": ContainerPropertyApply(FileReference),
372372
... "prop25": ContainerPropertyApply(FileReference(is_list=True)),

cognite/client/_sync_api/events.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""
22
===============================================================================
3-
8b6c6ae83aaf32dec50a4e3acf4ff5cb
3+
ec9cf1d4c5cc823ad1e9a5a0d287a540
44
This file is auto-generated from the Async API modules, - do not edit manually!
55
===============================================================================
66
"""
@@ -121,7 +121,7 @@ def __call__(
121121
type (str | None): Type of the event, e.g 'failure'.
122122
subtype (str | None): Subtype of the event, e.g 'electrical'.
123123
metadata (dict[str, str] | None): Customizable extra data about the event. String key -> String value.
124-
asset_ids (Sequence[int] | None): Asset IDs of related equipments that this event relates to.
124+
asset_ids (Sequence[int] | None): Asset IDs of related equipment that this event relates to.
125125
asset_external_ids (SequenceNotStr[str] | None): Asset External IDs of related equipment that this event relates to.
126126
asset_subtree_ids (int | Sequence[int] | None): Only include events that have a related asset in a subtree rooted at any of these assetIds. If the total size of the given subtrees exceeds 100,000 assets, an error will be returned.
127127
asset_subtree_external_ids (str | SequenceNotStr[str] | None): Only include events that have a related asset in a subtree rooted at any of these assetExternalIds. If the total size of the given subtrees exceeds 100,000 assets, an error will be returned.
@@ -655,7 +655,7 @@ def list(
655655
type (str | None): Type of the event, e.g 'failure'.
656656
subtype (str | None): Subtype of the event, e.g 'electrical'.
657657
metadata (dict[str, str] | None): Customizable extra data about the event. String key -> String value.
658-
asset_ids (Sequence[int] | None): Asset IDs of related equipments that this event relates to.
658+
asset_ids (Sequence[int] | None): Asset IDs of related equipment that this event relates to.
659659
asset_external_ids (SequenceNotStr[str] | None): Asset External IDs of related equipment that this event relates to.
660660
asset_subtree_ids (int | Sequence[int] | None): Only include events that have a related asset in a subtree rooted at any of these assetIds. If the total size of the given subtrees exceeds 100,000 assets, an error will be returned.
661661
asset_subtree_external_ids (str | SequenceNotStr[str] | None): Only include events that have a related asset in a subtree rooted at any of these assetExternalIds. If the total size of the given subtrees exceeds 100,000 assets, an error will be returned.

0 commit comments

Comments
 (0)