Skip to content

Commit 191e024

Browse files
authored
Merge pull request #1004 from opsmill/pog-ruff-doc-rules
Split apart ruff doc rules and add whitespace to docstrings
2 parents 70d739c + 0b64035 commit 191e024

78 files changed

Lines changed: 331 additions & 237 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/python-sdk/sdk_ref/infrahub_sdk/client.mdx

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -320,8 +320,9 @@ Allocate a new IP address by using the provided resource pool.
320320
- `timeout`: Flag to indicate whether to populate the store with the retrieved nodes.
321321
- `tracker`: The offset for pagination.
322322

323-
Returns:
324-
InfrahubNode: Node corresponding to the allocated resource.
323+
**Returns:**
324+
325+
- Node corresponding to the allocated resource.
325326

326327
</details>
327328
#### `allocate_next_ip_prefix`
@@ -359,8 +360,9 @@ Allocate a new IP prefix by using the provided resource pool.
359360
- `timeout`: Flag to indicate whether to populate the store with the retrieved nodes.
360361
- `tracker`: The offset for pagination.
361362

362-
Returns:
363-
InfrahubNode: Node corresponding to the allocated resource.
363+
**Returns:**
364+
365+
- Node corresponding to the allocated resource.
364366

365367
</details>
366368
#### `create_batch`
@@ -708,8 +710,9 @@ Allocate a new IP address by using the provided resource pool.
708710
- `timeout`: Flag to indicate whether to populate the store with the retrieved nodes.
709711
- `tracker`: The offset for pagination.
710712

711-
Returns:
712-
InfrahubNodeSync: Node corresponding to the allocated resource.
713+
**Returns:**
714+
715+
- Node corresponding to the allocated resource.
713716

714717
</details>
715718
#### `allocate_next_ip_prefix`
@@ -747,8 +750,9 @@ Allocate a new IP prefix by using the provided resource pool.
747750
- `timeout`: Flag to indicate whether to populate the store with the retrieved nodes.
748751
- `tracker`: The offset for pagination.
749752

750-
Returns:
751-
InfrahubNodeSync: Node corresponding to the allocated resource.
753+
**Returns:**
754+
755+
- Node corresponding to the allocated resource.
752756

753757
</details>
754758
#### `repository_update_commit`

docs/docs_generation/compatibility.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ class ReleaseMapping:
1717
infrahub: Infrahub server version (e.g. "1.8.4").
1818
sdk: SDK version pinned to this release (e.g. "1.19.0").
1919
date: Infrahub release date in YYYY-MM-DD format.
20+
2021
"""
2122

2223
infrahub: str
@@ -32,6 +33,7 @@ class VersionRange:
3233
infrahub: Infrahub minor version pattern (e.g. "1.8.x").
3334
min_sdk: Minimum required SDK version (e.g. "1.19.0").
3435
date: Approximate release month (e.g. "March 2026").
36+
3537
"""
3638

3739
infrahub: str
@@ -46,6 +48,7 @@ class PythonSupport:
4648
Args:
4749
sdk_range: SDK version range description (e.g. ">= 1.17.0").
4850
python_versions: Comma-separated Python versions (e.g. "3.10, 3.11, 3.12, 3.13, 3.14").
51+
4952
"""
5053

5154
sdk_range: str
@@ -60,6 +63,7 @@ class FeatureRequirement:
6063
feature: Feature name or description.
6164
min_sdk: Minimum SDK version required.
6265
min_infrahub: Minimum Infrahub version required.
66+
6367
"""
6468

6569
feature: str

docs/docs_generation/content_gen_methods/command_output_method.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ class CommandOutputDocContentGenMethod(ADocContentGenMethod):
3030
command=TyperCommand(module="infrahub_sdk.ctl.cli_commands", name="dump", app_name="infrahubctl", is_function=True),
3131
)
3232
content = method.apply()
33+
3334
"""
3435

3536
def __init__(self, context: Context, working_directory: Path, command: ACommand) -> None:

docs/docs_generation/content_gen_methods/file_printing_method.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ class FilePrintingDocContentGenMethod(ADocContentGenMethod):
1313
1414
Args:
1515
file: The ``MdxFile`` whose content will be returned.
16+
1617
"""
1718

1819
def __init__(self, file: MdxFile) -> None:

docs/docs_generation/content_gen_methods/jinja2_method.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ class Jinja2DocContentGenMethod(ADocContentGenMethod):
2929
template_variables={"builtin": BUILTIN_FILTERS},
3030
)
3131
content = method.apply()
32+
3233
"""
3334

3435
def __init__(self, template: Jinja2Template, template_variables: dict[str, Any]) -> None:

docs/docs_generation/content_gen_methods/mdx/mdx_code_doc.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ class MdxCodeDocumentation(ACodeDocumentation):
9292
9393
doc = MdxCodeDocumentation()
9494
files = doc.generate(context=ctx, modules_to_document=["infrahub_sdk.node"])
95+
9596
"""
9697

9798
def __init__(

docs/docs_generation/content_gen_methods/mdx/mdx_priority.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ class PagePriority:
2323
classes: Ordered list of class/function names to appear first on the page.
2424
methods: Per-class ordered list of method names to appear first.
2525
Key is class name, value is ordered method name list.
26+
2627
"""
2728

2829
sections: list[str] = field(default_factory=list)
@@ -46,6 +47,7 @@ class SectionPriority:
4647
names: Ordered list of child section names to appear first.
4748
sub_priorities: Per-child priorities for deeper nesting.
4849
Key is child name, value is ordered subsection name list.
50+
4951
"""
5052

5153
names: list[str] = field(default_factory=list)

docs/docs_generation/content_gen_methods/mdx/mdx_section.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ class MdxSection(ASection):
3030
name: Item name extracted from the heading (e.g. class or method name).
3131
heading_level: Markdown heading level (2, 3, or 4).
3232
_lines: All lines belonging to this section, including the heading.
33+
3334
"""
3435

3536
name: str

docs/docs_generation/helpers.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ def get_env_vars() -> dict[str, list[str]]:
1313
1414
Returns:
1515
Mapping of field name to list of upper-cased environment variable names.
16+
1617
"""
1718
env_vars: dict[str, list[str]] = defaultdict(list)
1819
settings = ConfigBase()
@@ -47,6 +48,7 @@ def build_config_properties() -> list[dict[str, Any]]:
4748
Returns:
4849
List of dicts with keys: ``name``, ``description``, ``type``,
4950
``choices``, ``default``, ``env_vars``.
51+
5052
"""
5153
schema = ConfigBase.model_json_schema()
5254
env_vars = get_env_vars()

docs/docs_generation/pages/base.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ class DocPage:
1818
1919
page = DocPage(content_gen_method=Jinja2DocContentGenMethod(...))
2020
print(page.content())
21+
2122
"""
2223

2324
def __init__(self, content_gen_method: ADocContentGenMethod) -> None:
@@ -38,6 +39,7 @@ class MDXDocPage:
3839
3940
mdx = MDXDocPage(page=my_page, output_path=Path("docs/ref/client.mdx"))
4041
mdx.to_mdx()
42+
4143
"""
4244

4345
_CONTROL_CHAR_RE = re.compile(r"[\x00-\x08\x0b\x0c\x0e-\x1f\x7f]")

0 commit comments

Comments
 (0)