Skip to content

chore(protocols): drop the unused PAT_MAC_ADDR from ospf.py (#1844) - #1864

Merged
JarryShaw merged 1 commit into
mainfrom
chore/1844-ospf-dead-pattern
Oct 16, 2026
Merged

JarryShaw merged 1 commit into
mainfrom
chore/1844-ospf-dead-pattern

Conversation

@JarryShaw

Copy link
Copy Markdown
Owner

Please follow the guide below

What is the purpose of your pull request?

Tick the commit type your subject line carries.

  • 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

Removes PAT_MAC_ADDR and the import re that existed only for it from pcapkit/protocols/application/ospf.py. Nothing read either: git grep finds only the definition, plus the separate copies in link/ethernet.py, link/arp.py and misc/pcapng.py, which have readers and stay.

Tests: test_ospf_dead_pattern_1844_unit.py pins that the constant is gone and that the module does not import re without using it. It fails on main and passes here. The OSPF test files and test_isort_clean.py pass.

Closes #1844

- pcapkit/protocols/application/ospf.py: delete `PAT_MAC_ADDR`, which nothing
  read and which came along unchanged when OSPF moved here in #1031, and the
  `import re` that existed only to compile it. The copies in the Ethernet, ARP
  and PCAP-NG modules have readers and stay.
- tests: pin that the constant is gone and that the module does not import
  `re` without using it.

Closes #1844
@JarryShaw JarryShaw added chore Maintenance work: tooling, repo hygiene, no library behaviour change review: running A cross-review is in flight against the current head - no verdict yet labels Oct 16, 2026
@JarryShaw

Copy link
Copy Markdown
Owner Author

Verdict: GOOD TO GO at d2a35c203. A Sonnet cross-review (author: Opus) confirmed the following:

  • Nothing reads ospf.PAT_MAC_ADDR or re. There is no star import or attribute access; the module's only importers take OSPF.
  • The constant was never in __all__ or documented, and it was already unused at v1.4.1's link/ospf.py. That old path is covered by the module's versionremoved:: 1.5.0, so no further note is owed.
  • The new test fails on main (test_pat_mac_addr_is_gone), catches a half-fix that keeps import re, and does not misfire on a real use of re.

One nit, not blocking: the ARP module's pattern differs from the Ethernet and PCAP-NG ones, so "copies" is loose.

@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 16, 2026
@JarryShaw
JarryShaw merged commit 8a37649 into main Oct 16, 2026
52 checks passed
@JarryShaw
JarryShaw deleted the chore/1844-ospf-dead-pattern branch October 16, 2026 23:41
@JarryShaw JarryShaw removed the review: good-to-go Cross-review at the current head says ready; CI state is separate label Oct 16, 2026
@JarryShaw JarryShaw moved this to Done in PyPCAPKit Oct 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Maintenance work: tooling, repo hygiene, no library behaviour change

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

chore(protocols): ospf.py defines an unused PAT_MAC_ADDR

1 participant