Skip to content

Commit 25bbc92

Browse files
authored
Merge pull request #1022 from opsmill/pog-documentation-formatting
Fix docstring formatting
2 parents 0e08c56 + 3f1f737 commit 25bbc92

54 files changed

Lines changed: 276 additions & 222 deletions

Some content is hidden

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

docs/docs/infrahubctl/infrahubctl-graphql.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ $ infrahubctl graphql export-schema [OPTIONS]
3737

3838
## `infrahubctl graphql generate-return-types`
3939

40-
Create Pydantic Models for GraphQL query return types
40+
Create Pydantic Models for GraphQL query return types.
4141

4242
**Usage**:
4343

docs/docs/infrahubctl/infrahubctl-validate.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ $ infrahubctl validate [OPTIONS] COMMAND [ARGS]...
2121

2222
## `infrahubctl validate graphql-query`
2323

24-
Validate the format of a GraphQL Query stored locally by executing it on a remote GraphQL endpoint
24+
Validate the format of a GraphQL Query stored locally by executing it on a remote GraphQL endpoint.
2525

2626
**Usage**:
2727

@@ -44,7 +44,7 @@ $ infrahubctl validate graphql-query [OPTIONS] QUERY [VARIABLES]...
4444

4545
## `infrahubctl validate schema`
4646

47-
Validate the format of a schema file either in JSON or YAML
47+
Validate the format of a schema file either in JSON or YAML.
4848

4949
**Usage**:
5050

docs/docs/python-sdk/sdk_ref/infrahub_sdk/client.mdx

Lines changed: 29 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -101,15 +101,15 @@ Return the Infrahub version.
101101
get_user(self) -> dict
102102
```
103103

104-
Return user information
104+
Return user information.
105105

106106
#### `get_user_permissions`
107107

108108
```python
109109
get_user_permissions(self) -> dict
110110
```
111111

112-
Return user permissions
112+
Return user permissions.
113113

114114
#### `count`
115115

@@ -140,7 +140,7 @@ all(self, kind: str, at: Timestamp | None = ..., branch: str | None = ..., timeo
140140
all(self, kind: str | type[SchemaType], at: Timestamp | None = None, branch: str | None = None, timeout: int | None = None, populate_store: bool = True, offset: int | None = None, limit: int | None = None, include: list[str] | None = None, exclude: list[str] | None = None, fragment: bool = False, prefetch_relationships: bool = False, property: bool = False, parallel: bool = False, order: Order | None = None, include_metadata: bool = False, query_name: str | None = None) -> list[InfrahubNode] | list[SchemaType]
141141
```
142142

143-
Retrieve all nodes of a given kind
143+
Retrieve all nodes of a given kind.
144144

145145
**Args:**
146146

@@ -219,7 +219,7 @@ Retrieve nodes of a given kind based on provided filters.
219219
clone(self, branch: str | None = None) -> InfrahubClient
220220
```
221221

222-
Return a cloned version of the client using the same configuration
222+
Return a cloned version of the client using the same configuration.
223223

224224
#### `execute_graphql`
225225

@@ -228,6 +228,7 @@ execute_graphql(self, query: str, variables: dict | None = None, branch_name: st
228228
```
229229

230230
Execute a GraphQL query (or mutation).
231+
231232
If retry_on_failure is True, the query will retry until the server becomes reachable.
232233

233234
**Args:**
@@ -238,6 +239,10 @@ If retry_on_failure is True, the query will retry until the server becomes reach
238239
- `at`: Time when the query should be executed. Defaults to None.
239240
- `timeout`: Timeout in second for the query. Defaults to None.
240241

242+
**Returns:**
243+
244+
- The GraphQL data payload (response["data"]).
245+
241246
**Raises:**
242247

243248
- `GraphQLError`: When the GraphQL response contains errors.
@@ -246,10 +251,6 @@ If retry_on_failure is True, the query will retry until the server becomes reach
246251
- `URLNotFoundError`: If the server returns a 404 response.
247252
- `Error`: If the response is unexpectedly missing.
248253

249-
**Returns:**
250-
251-
- The GraphQL data payload (response["data"]).
252-
253254
#### `refresh_login`
254255

255256
```python
@@ -405,10 +406,11 @@ repository_update_commit(self, branch_name: str, repository_id: str, commit: str
405406
convert_object_type(self, node_id: str, target_kind: str, branch: str | None = None, fields_mapping: dict[str, ConversionFieldInput] | None = None) -> InfrahubNode
406407
```
407408

408-
Convert a given node to another kind on a given branch. `fields_mapping` keys are target fields names
409-
and its values indicate how to fill in these fields. Any mandatory field not having an equivalent field
410-
in the source kind should be specified in this mapping. See https://docs.infrahub.app/guides/object-conversion
411-
for more information.
409+
Convert a given node to another kind on a given branch.
410+
411+
`fields_mapping` keys are target fields names and its values indicate how to fill in these fields.
412+
Any mandatory field not having an equivalent field in the source kind should be specified in this
413+
mapping. See https://docs.infrahub.app/guides/object-conversion for more information.
412414

413415
### `InfrahubClientSync`
414416

@@ -502,23 +504,23 @@ Return the Infrahub version.
502504
get_user(self) -> dict
503505
```
504506

505-
Return user information
507+
Return user information.
506508

507509
#### `get_user_permissions`
508510

509511
```python
510512
get_user_permissions(self) -> dict
511513
```
512514

513-
Return user permissions
515+
Return user permissions.
514516

515517
#### `clone`
516518

517519
```python
518520
clone(self, branch: str | None = None) -> InfrahubClientSync
519521
```
520522

521-
Return a cloned version of the client using the same configuration
523+
Return a cloned version of the client using the same configuration.
522524

523525
#### `execute_graphql`
524526

@@ -527,6 +529,7 @@ execute_graphql(self, query: str, variables: dict | None = None, branch_name: st
527529
```
528530

529531
Execute a GraphQL query (or mutation).
532+
530533
If retry_on_failure is True, the query will retry until the server becomes reachable.
531534

532535
**Args:**
@@ -537,6 +540,10 @@ If retry_on_failure is True, the query will retry until the server becomes reach
537540
- `at`: Time when the query should be executed. Defaults to None.
538541
- `timeout`: Timeout in second for the query. Defaults to None.
539542

543+
**Returns:**
544+
545+
- The GraphQL data payload (`response["data"]`).
546+
540547
**Raises:**
541548

542549
- `GraphQLError`: When the GraphQL response contains errors.
@@ -545,10 +552,6 @@ If retry_on_failure is True, the query will retry until the server becomes reach
545552
- `URLNotFoundError`: If the server returns a 404 response.
546553
- `Error`: If the response is unexpectedly missing.
547554

548-
**Returns:**
549-
550-
- The GraphQL data payload (`response["data"]`).
551-
552555
#### `count`
553556

554557
```python
@@ -578,7 +581,7 @@ all(self, kind: str, at: Timestamp | None = ..., branch: str | None = ..., timeo
578581
all(self, kind: str | type[SchemaTypeSync], at: Timestamp | None = None, branch: str | None = None, timeout: int | None = None, populate_store: bool = True, offset: int | None = None, limit: int | None = None, include: list[str] | None = None, exclude: list[str] | None = None, fragment: bool = False, prefetch_relationships: bool = False, property: bool = False, parallel: bool = False, order: Order | None = None, include_metadata: bool = False, query_name: str | None = None) -> list[InfrahubNodeSync] | list[SchemaTypeSync]
579582
```
580583

581-
Retrieve all nodes of a given kind
584+
Retrieve all nodes of a given kind.
582585

583586
**Args:**
584587

@@ -811,10 +814,11 @@ login(self, refresh: bool = False) -> None
811814
convert_object_type(self, node_id: str, target_kind: str, branch: str | None = None, fields_mapping: dict[str, ConversionFieldInput] | None = None) -> InfrahubNodeSync
812815
```
813816

814-
Convert a given node to another kind on a given branch. `fields_mapping` keys are target fields names
815-
and its values indicate how to fill in these fields. Any mandatory field not having an equivalent field
816-
in the source kind should be specified in this mapping. See https://docs.infrahub.app/guides/object-conversion
817-
for more information.
817+
Convert a given node to another kind on a given branch.
818+
819+
`fields_mapping` keys are target fields names and its values indicate how to fill in these fields.
820+
Any mandatory field not having an equivalent field in the source kind should be specified in this
821+
mapping. See https://docs.infrahub.app/guides/object-conversion for more information.
818822

819823
### `ProcessRelationsNode`
820824

@@ -826,7 +830,7 @@ for more information.
826830

827831
### `BaseClient`
828832

829-
Base class for InfrahubClient and InfrahubClientSync
833+
Base class for InfrahubClient and InfrahubClientSync.
830834

831835
**Methods:**
832836

docs/docs/python-sdk/sdk_ref/infrahub_sdk/node/node.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -626,7 +626,7 @@ caller re-fetches the node first.
626626

627627
### `InfrahubNodeBase`
628628

629-
Base class for InfrahubNode and InfrahubNodeSync
629+
Base class for InfrahubNode and InfrahubNodeSync.
630630

631631
**Methods:**
632632

docs/docs/python-sdk/sdk_ref/infrahub_sdk/node/relationship.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ sidebarTitle: relationship
99

1010
### `RelationshipManagerBase`
1111

12-
Base class for RelationshipManager and RelationshipManagerSync
12+
Base class for RelationshipManager and RelationshipManagerSync.
1313

1414
**Methods:**
1515

docs/docs_generation/content_gen_methods/mdx/mdx_collapsed_overload_section.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88

99
@dataclass
1010
class CollapsedOverloadSection(ASection):
11-
"""Collapses a group of overloaded method sections into one primary entry
12-
followed by a collapsible ``<details>`` block with the remaining overloads.
11+
"""Collapse a group of overloaded method sections into a primary entry plus a details block.
1312
14-
The *primary* overload is the one with the most parameters (excluding
13+
The remaining overloads are placed inside a collapsible ``<details>`` block following the
14+
primary entry. The *primary* overload is the one with the most parameters (excluding
1515
``self``). On ties, the first in source order wins.
1616
1717
Example::

infrahub_sdk/analyzer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,12 @@ def variables(self) -> list[GraphQLQueryVariable]:
9999
return response
100100

101101
async def calculate_depth(self) -> int:
102-
"""Number of nested levels in the query"""
102+
"""Number of nested levels in the query."""
103103
fields = await self.get_fields()
104104
return calculate_dict_depth(data=fields)
105105

106106
async def calculate_height(self) -> int:
107-
"""Total number of fields requested in the query"""
107+
"""Total number of fields requested in the query."""
108108
fields = await self.get_fields()
109109
return calculate_dict_height(data=fields)
110110

infrahub_sdk/checks.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,11 +147,12 @@ def validate(self, data: dict) -> None:
147147
"""Code to validate the status of this check."""
148148

149149
async def collect_data(self) -> dict:
150-
"""Query the result of the GraphQL Query defined in self.query and return the result"""
150+
"""Query the result of the GraphQL Query defined in self.query and return the result."""
151151
return await self.client.query_gql_query(name=self.query, branch_name=self.branch_name, variables=self.params)
152152

153153
async def run(self, data: dict | None = None) -> bool:
154154
"""Execute the check after collecting the data from the GraphQL query.
155+
155156
The result of the check is determined based on the presence or not of ERROR log messages.
156157
"""
157158
if not data:

0 commit comments

Comments
 (0)