Skip to content

docs(foundation): document RegistryError on the method-name registrars (#2176) - #2183

Merged
JarryShaw merged 1 commit into
mainfrom
docs/2176-registrar-raises
Oct 25, 2026
Merged

JarryShaw merged 1 commit into
mainfrom
docs/2176-registrar-raises

Conversation

@JarryShaw

Copy link
Copy Markdown
Owner

What is the purpose of your pull request?

  • docs — documentation only

Description

Closes #2176.

  • Defect: the registrars in pcapkit/foundation/registry/protocols.py that take a parser-method name raise RegistryError when meth has no matching _read_* method, but none of them documented it.
  • Fix: each gets a Raises: section naming its own prefix. That covers the eight the issue lists plus the same gap in register_tcp_option, register_tcp_mp_option, register_http_frame and the four register_pcapng_* registrars. Every one was reproduced raising on main.
  • Scope: docstring-only; with docstrings stripped, the AST matches main. No new test, because the docstring contract checks documented names, not missing Raises:.
  • Tests run: test_docstring_contract.py, test_protocols.py and test_registry_symmetry_unit.py pass (27).
  • Overlap: docs(foundation): fifth whole-repo pass over foundation, toolkit, dumpkit, interface and utilities (#1103) #2157 also edits this file; the two merge cleanly.

#2176)

Problem: the registrars in pcapkit/foundation/registry/protocols.py that take
a method name raise RegistryError when meth names no matching _read_* method,
and none of them documents it.

Fix: add a Raises: section, naming each registrar's own _read_* prefix, to
register_ipv4_option, register_hip_parameter, register_hopopt_option,
register_ipv6_opts_option, register_ipv6_route_routing, register_mh_message,
register_mh_option, register_mh_extension, register_tcp_option,
register_tcp_mp_option, register_http_frame, register_pcapng_block,
register_pcapng_option, register_pcapng_record and register_pcapng_secrets.
Docstring-only; the AST with docstrings stripped is unchanged.

Test: tests/test_docstring_contract.py passes.
@JarryShaw JarryShaw added docs Pull requests that change documentation only (docs: subject prefix) review: running A cross-review is in flight against the current head - no verdict yet labels Oct 25, 2026
@JarryShaw

Copy link
Copy Markdown
Owner Author

Review: GOOD TO GO at 1c399dbfa (Sonnet): all 15 registrars reproduced raising RegistryError, each prefix matches its hasattr check, AST unchanged. The code.name gap it found is filed separately.

@JarryShaw JarryShaw added review: good-to-go Cross-review at the current head says ready; CI state is separate and removed review: running A cross-review is in flight against the current head - no verdict yet labels Oct 25, 2026
@JarryShaw JarryShaw moved this to In review in PyPCAPKit Oct 25, 2026
@JarryShaw

Copy link
Copy Markdown
Owner Author

Ready to merge at 1c399dbfa. Merging closes #2176.

@github-actions

Copy link
Copy Markdown
Contributor

Coverage: 91.55% (unit tier, Python 3.15, 1c399dbfa, Unit Tests run success)

Package Statements Missed Branches Partial Cover
pcapkit (top level) 104 4 20 2 95.16%
pcapkit/const 19599 880 2618 866 92.12%
pcapkit/corekit 2589 75 816 37 96.48%
pcapkit/dumpkit 282 3 102 3 98.44%
pcapkit/foundation 2971 23 1036 25 98.80%
pcapkit/interface 138 4 52 3 96.32%
pcapkit/protocols 17418 219 4574 185 98.14%
pcapkit/toolkit 869 36 298 10 95.20%
pcapkit/utilities 504 7 146 5 98.15%
pcapkit/vendor 4432 1988 1018 167 51.87%

Per-file detail: the coverage-html artifact of this run.

@JarryShaw
JarryShaw merged commit 130b603 into main Oct 25, 2026
67 checks passed
@github-project-automation github-project-automation Bot moved this from In review to Done in PyPCAPKit Oct 25, 2026
@JarryShaw
JarryShaw deleted the docs/2176-registrar-raises branch October 25, 2026 14:43
@JarryShaw JarryShaw removed the review: good-to-go Cross-review at the current head says ready; CI state is separate label Oct 25, 2026
@JarryShaw JarryShaw added this to the PyPCAPKit v1.5 milestone Oct 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Pull requests that change documentation only (docs: subject prefix)

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

docs(foundation): eight method-name registrars raise RegistryError without documenting it

1 participant