Skip to content

refactor(protocols): reorder misc, schema and base class members to the member-order convention (#2490) - #2539

Merged
JarryShaw merged 1 commit into
mainfrom
refactor/2490-member-order-misc-schema-protocol
Nov 1, 2026
Merged

JarryShaw merged 1 commit into
mainfrom
refactor/2490-member-order-misc-schema-protocol

Conversation

@JarryShaw

Copy link
Copy Markdown
Owner

What is the purpose of your pull request?

  • fix — corrects a defect
  • feat — adds a feature
  • perf — changes performance, not behaviour
  • refactor — changes neither behaviour nor performance
  • test — tests only
  • docs — documentation only
  • ci — workflows or build tooling
  • release — bumps the version or rolls up a distribution
  • chore — anything else
  • const — regenerates constant or registry tables, members keeping their numeric values

Description of your pull request and other information

Part of #2490. A pure reorder to protocol-member-order.rst, covering pcapkit/protocols/protocol.py, misc/pcap/frame.py, misc/pcap/header.py, misc/pcapng.py, schema/schema.py, schema/misc/pcapng.py and schema/internet/ipv6.py. An AST check confirms the member set, every member body and the comments are unchanged; only the order differs.

@JarryShaw JarryShaw moved this to In review in PyPCAPKit Nov 1, 2026
@JarryShaw JarryShaw added refactor Restructuring for its own sake — neither a fix nor a new capability (refactor: prefix) review: good-to-go Cross-review at the current head says ready; CI state is separate labels Nov 1, 2026
@JarryShaw

Copy link
Copy Markdown
Owner Author

Cross-review (Sonnet) of all four #2490 branches, this one at 149775b1b: GOOD TO GO. The reviewer's AST checker finds identical module-level statements and, in every class, the same members with identical bodies; only the order differs, across the 7 misc, schema and protocol.py files. The only non-reorder edit is a section-banner fix. Non-blocking points are the same as on #2522 and are raised on #2490.

@github-actions

github-actions Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

Coverage: 93.94% (unit tier, Python 3.15, 149775b1b, Unit Tests run success)

Package Statements Missed Branches Partial Cover
pcapkit (top level) 104 4 20 2 95.16%
pcapkit/const 20087 144 2710 125 98.78%
pcapkit/corekit 2605 74 818 37 96.52%
pcapkit/dumpkit 281 3 100 3 98.43%
pcapkit/foundation 3194 27 1112 31 98.65%
pcapkit/interface 138 4 52 3 96.32%
pcapkit/protocols 19906 213 5236 207 98.32%
pcapkit/toolkit 924 36 334 10 95.55%
pcapkit/utilities 502 7 144 5 98.14%
pcapkit/vendor 5009 2222 1148 182 52.31%

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

…he member-order convention (#2490)

- protocol: move _packing_target and _next_layer_entry out of Methods, and
  _make_data to the head of Utilities.
- pcap frame/header: move Frame.__index__ into Data models and its private
  helpers into Utilities after _make_data; move Header.from_data into Methods.
- pcapng: move _make_data to the head of Utilities, then the helpers read()
  calls directly, in first-use order (_read_block_short with its maker).
- schema: put Methods ahead of Data models in Schema, EnumSchema, Option,
  FlagsField, OptionEnumField and SystemdJournalExportBlock; put the IPv6
  schema's TYPE_CHECKING __init__ stub after post_process.

Pure move: member set, member ASTs and comments are unchanged.
@JarryShaw

Copy link
Copy Markdown
Owner Author

Resolve conflicts

@JarryShaw

Copy link
Copy Markdown
Owner Author

Conflicts resolved, as asked: 149775b1b → 6a949ca7e, one commit on main.

@JarryShaw
JarryShaw force-pushed the refactor/2490-member-order-misc-schema-protocol branch from 149775b to 6a949ca Compare November 1, 2026 16:25
@JarryShaw
JarryShaw merged commit 93d3405 into main Nov 1, 2026
3 of 12 checks passed
@github-project-automation github-project-automation Bot moved this from In review to Done in PyPCAPKit Nov 1, 2026
@JarryShaw
JarryShaw deleted the refactor/2490-member-order-misc-schema-protocol branch November 1, 2026 16:28
@JarryShaw JarryShaw removed the review: good-to-go Cross-review at the current head says ready; CI state is separate label Nov 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor Restructuring for its own sake — neither a fix nor a new capability (refactor: prefix)

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant