From ab24c85f28b0412f839998e12c1db1d08304f09c Mon Sep 17 00:00:00 2001 From: Miauwkeru Date: Wed, 27 Aug 2025 08:56:57 +0000 Subject: [PATCH 1/3] Stop skipping OS modules during docs-build --- tests/_docs/conf.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/_docs/conf.py b/tests/_docs/conf.py index b366ffa034..86874a50d0 100644 --- a/tests/_docs/conf.py +++ b/tests/_docs/conf.py @@ -1,3 +1,5 @@ +from sphinx.application import Sphinx + project = "dissect.target" extensions = [ @@ -39,3 +41,15 @@ # https://github.com/readthedocs/sphinx-autoapi/issues/285 "autoapi.python_import_resolution", ] + + +def autoapi_skip_hook(app: Sphinx, what: str, name: str, obj: object, skip: bool, options: list[str]) -> bool: + # Do not skip OS modules in dissect.target (caught by `private-members`) + if name.endswith("._os") and what == "module": + skip = False + return skip + + +def setup(sphinx: Sphinx) -> None: + if "autoapi.extension" in extensions: + sphinx.connect("autoapi-skip-member", autoapi_skip_hook) From c98380fa3f113c390a50f796a0baa89552532d1d Mon Sep 17 00:00:00 2001 From: Miauwkeru Date: Wed, 27 Aug 2025 08:59:58 +0000 Subject: [PATCH 2/3] Add docstring to `ConfigNode` and `FortiOSConfig` Autoapi made it use the docstring of its parent `dict`. This docstring contains leading spaces that sphinx doesn't like. So I added some docstrings --- dissect/target/plugins/os/unix/linux/fortios/_os.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dissect/target/plugins/os/unix/linux/fortios/_os.py b/dissect/target/plugins/os/unix/linux/fortios/_os.py index 6127a94708..7333b4aa4c 100644 --- a/dissect/target/plugins/os/unix/linux/fortios/_os.py +++ b/dissect/target/plugins/os/unix/linux/fortios/_os.py @@ -338,6 +338,8 @@ def architecture(self) -> str | None: class ConfigNode(dict): + """Constructs a ``ConfigNodes`` using a list of paths.""" + def set(self, path: list[str], value: str) -> None: node = self @@ -353,6 +355,8 @@ def __getattr__(self, attr: str) -> ConfigNode | str: class FortiOSConfig(ConfigNode): + """Parses the fortios config file to a ``ConfigNode``.""" + @classmethod def from_fh(cls, fh: TextIO) -> Self: root = cls() From 4c3e0216aca4972fc8101bc0ba2ad6a5cc11c8e9 Mon Sep 17 00:00:00 2001 From: Miauwkeru Date: Thu, 19 Mar 2026 10:32:22 +0000 Subject: [PATCH 3/3] Fix linting --- tests/_docs/conf.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/_docs/conf.py b/tests/_docs/conf.py index 4cbb7058b3..fdb3ea022e 100644 --- a/tests/_docs/conf.py +++ b/tests/_docs/conf.py @@ -1,6 +1,9 @@ from __future__ import annotations -from sphinx.application import Sphinx +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from sphinx.application import Sphinx project = "dissect.target"