From 82e3258ccf08d2864d07b79a4bb1075349721285 Mon Sep 17 00:00:00 2001 From: Jarry Shaw Date: Wed, 23 Sep 2026 12:56:17 -0400 Subject: [PATCH] fix(docs): qualify the ambiguous Type refs in the foundation rst tree Sphinx defines several classes named Type across pcapkit (including pcapkit.const.l2tp.type.Type), so a bare `Type` in a hand-written :type: field is ambiguous and resolves silently to the wrong one -- confirmed by a docs build showing engine.rst's `Type[EngineBase]` linking to the L2TP enum instead of typing.Type. Qualify the four remaining bare-Type :type: fields in the docs/source tree to `typing.Type[...]`, matching the fully-qualified form already used at traceflow.rst:30: - docs/source/pcapkit/foundation/engines/engine.rst:40 - docs/source/pcapkit/foundation/reassembly/reassembly.rst:33,43 - docs/source/pcapkit/foundation/traceflow/traceflow.rst:40 Two more bare-Type sites remain in pcapkit/foundation/traceflow/ traceflow.py's `#:` comments (lines 146 and 406); those belong to the still-open #712 and are left untouched here. Part of #709. Verified with a full `make docs` warning diff: the four "more than one target found for cross-reference 'Type'" warnings drop to zero with no new warnings, and the built HTML now links `Type` to typing.Type instead of the L2TP enum. --- docs/source/pcapkit/foundation/engines/engine.rst | 2 +- docs/source/pcapkit/foundation/reassembly/reassembly.rst | 4 ++-- docs/source/pcapkit/foundation/traceflow/traceflow.rst | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/source/pcapkit/foundation/engines/engine.rst b/docs/source/pcapkit/foundation/engines/engine.rst index 99e87b6bdd..a55d049824 100644 --- a/docs/source/pcapkit/foundation/engines/engine.rst +++ b/docs/source/pcapkit/foundation/engines/engine.rst @@ -37,7 +37,7 @@ all engine support functionality. value can be set by :attr:`__engine_module__` class attribute. .. property:: registry - :type: dict[str, ModuleDescriptor[EngineBase] | Type[EngineBase]] + :type: dict[str, ModuleDescriptor[EngineBase] | typing.Type[EngineBase]] Mapping of engine names to engine classes. diff --git a/docs/source/pcapkit/foundation/reassembly/reassembly.rst b/docs/source/pcapkit/foundation/reassembly/reassembly.rst index 23c52179fb..1f554af8ae 100644 --- a/docs/source/pcapkit/foundation/reassembly/reassembly.rst +++ b/docs/source/pcapkit/foundation/reassembly/reassembly.rst @@ -30,7 +30,7 @@ implements datagram reassembly of IP and TCP packets. .. property:: protocol - :type: Type[Protocol] + :type: typing.Type[Protocol] Protocol of current reassembly class. @@ -40,7 +40,7 @@ implements datagram reassembly of IP and TCP packets. value can be set by :attr:`__protocol_type__` class attribute. .. property:: registry - :type: dict[str, ModuleDescriptor[ReassemblyBase] | Type[ReassemblyBase]] + :type: dict[str, ModuleDescriptor[ReassemblyBase] | typing.Type[ReassemblyBase]] Mapping of protocol names to reassembly classes. diff --git a/docs/source/pcapkit/foundation/traceflow/traceflow.rst b/docs/source/pcapkit/foundation/traceflow/traceflow.rst index 6c78081379..1d7f586683 100644 --- a/docs/source/pcapkit/foundation/traceflow/traceflow.rst +++ b/docs/source/pcapkit/foundation/traceflow/traceflow.rst @@ -37,7 +37,7 @@ which is an abstract base class for all flow tracing classes. value can be set by :attr:`__protocol_type__` class attribute. .. property:: registry - :type: dict[str, ModuleDescriptor[TraceFlowBase] | Type[TraceFlowBase]] + :type: dict[str, ModuleDescriptor[TraceFlowBase] | typing.Type[TraceFlowBase]] Mapping of protocol names to flow tracing classes.