Skip to content

docs: prose sweep after the defect wave (foundation-docs) (#1103) - #1186

Merged
JarryShaw merged 1 commit into
mainfrom
docs/1103-foundation-docs
Oct 7, 2026
Merged

JarryShaw merged 1 commit into
mainfrom
docs/1103-foundation-docs

Conversation

@JarryShaw

Copy link
Copy Markdown
Owner

Please follow the guide below

  • Searched for similar pull requests
  • Followed the coding style (make pylint, make mypy, make isort) — not run; comments and docstrings only
  • make test passes, and a test case covers the change — tests/project only (389 passed, 1 skipped)
  • Added a changelog entry — N/A, added centrally

What is the purpose of your pull request?

  • docs — documentation only

Description of your pull request and other information

Part of #1103: the foundation-docs slice of the post-wave prose sweep.

  • Extractor._open_output: only the PCAP engine passes header fields; PCAP-NG passes none. run() and PCAPNG.run() now list the PCAP-output-on-PCAP-NG FormatError (probed).
  • _ofile comment, PCAPIO **kwargs, and the JSON-key NOTE (\ escapes, " closes) brought in line with the code; timed context cut from all.py.
  • Docs: _open_output/_flag_o documented on the extraction page; the engine gap table gains the PCAP-output rows; the ext.rst PoC engine calls record_header as the real Scapy engine does.
  • pep.rst, process.rst, httpv2.rst, ospf.rst, tcp.rst checked against origin/main: no change needed.

Sphinx -b dummy -n, fresh dirs, warnings on these files: main 117, branch 116, none new.

File AST equal
pcapkit/all.py True
pcapkit/dumpkit/common.py True
pcapkit/dumpkit/pcap.py True
pcapkit/foundation/engines/pcapng.py True
pcapkit/foundation/extraction.py True

- extraction.py: _open_output names which engines pass header fields
  (PCAP does, PCAP-NG passes none); run() lists the PCAP-NG/PCAP
  FormatError; _ofile's comment covers its class/writer/factory states.
- engines/pcapng.py: run() documents its two FormatErrors.
- dumpkit/pcap.py: PCAPIO's **kwargs names thiszone/sigfigs/snaplen.
- dumpkit/common.py: a backslash in a JSON key escapes, not closes.
- all.py: drop the commit and date from the utilities comment.
- docs: extraction page documents _open_output and _flag_o; the engine
  gap table gains the PCAP-output rows; ext.rst's PoC engine calls
  record_header like the real Scapy engine.

Comments, docstrings and .rst only; AST guard True for every .py.
@JarryShaw JarryShaw moved this to In review in PyPCAPKit Oct 7, 2026
@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 7, 2026
@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

Coverage: 88.89% (unit tier, Python 3.14, 8dd8106a2, Unit Tests run success)

Package Statements Missed Branches Partial Cover
pcapkit (top level) 104 4 20 4 93.55%
pcapkit/const 18757 1034 2342 845 90.24%
pcapkit/corekit 1878 91 580 22 94.34%
pcapkit/dumpkit 142 0 42 0 100.00%
pcapkit/foundation 2442 102 852 39 94.38%
pcapkit/interface 112 7 40 5 92.11%
pcapkit/protocols 15707 188 3974 163 98.19%
pcapkit/toolkit 487 65 144 1 85.42%
pcapkit/utilities 429 4 122 4 98.55%
pcapkit/vendor 4409 2359 1006 158 42.84%

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

@JarryShaw

Copy link
Copy Markdown
Owner Author

Cross-review verdict on 8dd8106a2: GOOD TO GO (ran on Sonnet; author Opus). Labelled review: good-to-go.

  • _open_output: a spy on a real Extractor shows the default engine on PCAP input passing all six header fields, and PCAP-NG passing none. dpkt and scapy reach the same call through record_header().
  • run() Raises: PCAP output from a PCAP-NG input raises FormatError. dpkt and scapy fall back to json with a FormatWarning on either input. Both the docstring and the gap-table rows match this.
  • _ofile comment: _ofile holds the writer class, then a DictDumper instance, or a functools.partial under split mode.
  • JSON note: against raw dictdumper.JSON, a " breaks the parse and a \ escapes the next character. make_dumper round-trips all three cases.
  • ext.rst: the call matches scapy.py:178, ext.record_header() with no arguments, which I re-read myself.
  • Docs build: the new directives resolve, and a -n build emits no warning for them. _flag_o sits beside siblings that are already documented.
  • Code unchanged: the AST is identical to base for all five .py files once docstrings are blanked. The PR's True should be read as meaning docstring-stripped.
  • all.py: the reason for fix(all): pcapkit.all.__all__ omits names its packages export #1136's ruling is kept; only the timed context is cut.
  • Tests: tests/project, seven extraction modules, the engine runtime tests and five dumpkit modules all pass.

@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 7, 2026
@JarryShaw
JarryShaw merged commit f4c2883 into main Oct 7, 2026
41 checks passed
@JarryShaw
JarryShaw deleted the docs/1103-foundation-docs branch October 7, 2026 14:27
@JarryShaw JarryShaw removed the review: good-to-go Cross-review at the current head says ready; CI state is separate label Oct 7, 2026
@JarryShaw JarryShaw added this to the PyPCAPKit v1.5 milestone Oct 25, 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.

1 participant