Skip to content

const: the four AppType registries carry a stale consider-using-f-string disable with zero %-format sites #809

Description

@JarryShaw

Describe the bug

The four generated AppType registries each carry # pylint: disable=consider-using-f-string while containing zero %-format sites, so the suppression is stale. Found by #803's cross-review, confirmed genuinely stale with pylint's useless-suppression rather than inferred from a grep.

pcapkit/const/reg/apptype/tcp.py     %-format sites = 0   disable present
pcapkit/const/reg/apptype/udp.py     %-format sites = 0   disable present
pcapkit/const/reg/apptype/sctp.py    %-format sites = 0   disable present
pcapkit/const/reg/apptype/dccp.py    %-format sites = 0   disable present

Expected behavior

The disable dropped from all four, and from whatever emits it, so the suppression is earned everywhere in this family.

Additional context

The source is the fifth template, which #803 deliberately did not touch. TRANSPORT at pcapkit/vendor/reg/apptype/apptype.py:504 emits the four registry modules; #803's title scopes to "the four bespoke templates" and this is a fifth. So this is not a #803 regression — the disable is identically stale on main — it is the remainder of #798's "the disable being earned is the cheapest signal the work is unfinished" argument, applied one template further out.

make pylint cannot see this. useless-suppression is not in the Makefile's --enable set, so the staleness is invisible to CI and will stay invisible after this is fixed. Worth deciding whether to add it while here — that would catch the next stale disable for free, and it is the check that found this one.

Two traps, both hit while establishing this:

  • A %-format grep must allow both quote styles and multi-line strings. A pattern requiring single quotes reported 0 for files whose every site was double-quoted. The review used an AST walk over BinOp(Constant(str) % x) and self-tested it against known positives including a double-quoted and a triple-quoted case.
  • pylint --disable=all --enable=useless-suppression manufactures false hits — the review's first run produced bogus line-too-long/no-member reports that way. Use the real Makefile flag set plus useless-suppression.

Related: #798, #803, #804, #783.

Activity

  1. JarryShaw commented on Sep 25, 2026

    @JarryShaw
    OwnerAuthor

    Checkable blocker: #803 merged.

    gh pr view 803 -R JarryShaw/PyPCAPKit --json state,mergedAt
    

    #803 is review: good-to-go and rewrites pcapkit/vendor/reg/apptype/apptype.py — the file holding the TRANSPORT template at :504 that emits these four modules — plus const/reg/apptype/apptype.py. Landing this first would have one rewrite discard the other's edits with no conflict marker.

    Also note #806 will regenerate or hand-edit the same four registry files for the proto retyping, so if #806 starts before this lands, fold this in there rather than running both. Chain: #803 → this issue, with #806 as the item to coordinate with.

  2. added
    refactorRestructuring for its own sake — neither a fix nor a new capability (refactor: prefix)
    constRegenerated IANA or vendor constant tables; members keep their numeric values
    blockedDeferred pending another issue or decision; see the last comment for what unblocks it
    on Sep 25, 2026
  3. JarryShaw commented on Sep 25, 2026

    @JarryShaw
    OwnerAuthor

    #803 merged, so the original blocker has cleared — but this now waits on #806 instead. Re-blocked rather than opened.

    Checkable blocker: #806 merged.

    gh issue view 806 -R JarryShaw/PyPCAPKit --json state
    

    #806 retypes AppType.proto across all four registry files — pcapkit/const/reg/apptype/{tcp,udp,sctp,dccp}.py — and edits the vendor/reg/apptype/apptype.py template that emits them, which is where the stale disable originates (the TRANSPORT template). A worker is on #806 now. Doing this first would have #806's rewrite discard it.

    Fold this in with #806 if convenient, since it is four const files plus one template line and #806 is already rewriting all five. Otherwise it unblocks the moment #806 lands. Re-derive the :504 citation against origin/main (4530424df) — #803 moved that file.

  4. added
    wipWork in flight - a covering PR is open or an agent is actively on it
    and removed
    blockedDeferred pending another issue or decision; see the last comment for what unblocks it
    on Sep 26, 2026
  5. removed
    wipWork in flight - a covering PR is open or an agent is actively on it
    on Sep 26, 2026
  6. added this to the 1.5 milestone on Oct 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    constRegenerated IANA or vendor constant tables; members keep their numeric valuesrefactorRestructuring for its own sake — neither a fix nor a new capability (refactor: prefix)

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions