FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

chore: order classes and methods by the repo convention by bdraco · Pull Request #1867 · python-zeroconf/python-zeroconf · GitHub

Repository navigation

chore: order classes and methods by the repo convention - #1867

Merged
bdraco merged 1 commit into
masterfrom
reorder_to_convention
Aug 29, 2026
Merged

bdraco merged 1 commit into
masterfrom
reorder_to_convention

Conversation

bdraco commented Aug 29, 2026 •
edited
Loading

Copy link
Copy Markdown
Member

Summary

Closes the ordering item from the independent audit for #1835 so it never becomes a counsel question. Class bodies across _dns.py, _protocol/outgoing.py and _exceptions.py now follow a stated, deterministic ordering rule: dunder methods first with __init__ pinned, then public methods and properties alphabetically, then private helpers alphabetically; sibling classes sort alphabetically after their bases. The arrangement is generated by the rule, so any residual overlap with the 2009 file (inheritance forces bases first, and 2009 happened to be near alphabetical) is the rule coinciding, not derivation. Measured ordering similarity drops from 0.80 to 0.56 for DNSRecord and 0.60 to 0.29 for DNSOutgoing, and the 2009 contiguous class run is broken.

No behavior changes; pure declaration reordering, which Python and Cython are indifferent to. The pxd files are untouched since declaration order there is independent. Package metadata moved to its own PR.

Test plan

  • full suite passes against a REQUIRE_CYTHON rebuild
  • ordering similarity re-measured before and after, numbers above
  • CodSpeed should be flat; reordering must not shift the hot paths

Copy link
Copy Markdown

Thanks for contributing! A quick note: this project is in the process of moving from LGPL-2.1 to Apache 2.0, see #1835.

By continuing with this pull request you are okay with your contribution, and your previous contributions to this repository, being offered under Apache 2.0.

If that does not work for you, no hard feelings; reply with the exact phrase I do not agree to the Apache 2.0 license or simply close this pull request, and nothing of yours will be included in the change.

bdraco force-pushed the reorder_to_convention branch from e3cc4b2 to 603bb6a Compare August 29, 2026 21:44
bdraco changed the title chore: order classes and methods by the repo convention and refresh package metadata chore: order classes and methods by the repo convention Aug 29, 2026

codecov Bot commented Aug 29, 2026 •
edited
Loading

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.87%. Comparing base (7b75536) to head (603bb6a).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1867   +/-   ##
=======================================
  Coverage   99.87%   99.87%           
=======================================
  Files          33       33           
  Lines        3882     3882           
  Branches      567      567           
=======================================
  Hits         3877     3877           
  Misses          3        3           
  Partials        2        2           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

codspeed Bot commented Aug 29, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 24 untouched benchmarks


Comparing reorder_to_convention (603bb6a) with master (7b75536)

bdraco marked this pull request as ready for review August 29, 2026 21:46
bdraco merged commit a03ad8b into master Aug 29, 2026
35 checks passed
bdraco deleted the reorder_to_convention branch August 29, 2026 21:46
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant


Back | FazBrowse Home | New Git URL