Repository navigation
docs(vendor,const): convert bare citations to the issue role in generators and generated files - #1005
Conversation
|
GOOD TO GO at
Correcting my own brief: I told the reviewer that a role nested inside markup spanning a line break was a detection gap worth hunting. docutils resolves roles and One trade the body did not state, worth recording: the relaxed Not ready to merge: |
…er and const docstrings (#989) - Vendor generators: `#NNN` in docstrings, the LINE f-string templates' emitted docstrings, and `#:` attribute comments now use :issue:`NNN`. - Generated const modules (ftp.command, http.method, reg.apptype.apptype) carry the identical substitution by hand, so a regeneration is a no-op. - const/ngap/__init__.py is hand-written (no generator) and converts directly. - Plain `#` comments, including those emitted by templates, and the two ImportError messages in vendor/ngap keep the bare form. - test_const_method_value_lookup_908_unit: the two template-parity assertions match the citation with a regex accepting `#908` or :issue:`908`, instead of the exact bare string. Docstring/comment text only; 21 distinct numbers, all issues.
f89696f to
913e54c
Compare
|
Rebased onto The GOOD TO GO verdict carries to this head, and that is measured rather than assumed. The rebase is content-identical: Re-derived against the new base rather than carried over: 99 roles (50 The docs-build baseline did move with the merges — 81 warning lines to 83 — and this branch still adds none, with the same two pre-existing docutils errors. Awaiting fresh CI on the rebased head. |
|
Ready to merge at This is the last of #989's five Yours to merge. |
Please follow the guide below
make testpasses, and a test case covers the change —tests/vendor,tests/constand the docstring contract are green; two existing assertions updated, see belowWhat is the purpose of your pull request?
docs— documentation onlyDescription of your pull request and other information
Last tranche of #989, after #1000, #1002, #1003 and #1004. Covers
pcapkit/vendor/andpcapkit/const/.This one could not be done in the generated files alone.
pcapkit/const/docstrings are emitted by thepcapkit/vendor/generators — the same prose appears on both sides — so editing a const file would be reverted at the next regeneration. The conversion is made in the generator'sLINEtemplates and mirrored into the checked-in generated file. The crawlers were deliberately not run: they fetch live IANA and Wikipedia registries, #518 records 403s and a dead IETF URL against them, and a regeneration would pull unrelated registry churn into a citation-only diff.99 roles across 21 distinct numbers, every one an issue: 50 in ordinary string tokens, 37 inside the
LINEf-string templates, 12 in#:doc-comments.27 bare citations deliberately remain, and both groups are right to:
#comments in the generated const files, which the ruling on docs: bare #NNN citations do not resolve in Sphinx — add an extlinks role instead of auto-linking #989 keeps bare. Every one sits on a template line starting with#— checked individually, 25 of 25.ImportErrormessages (vendor/ngap/procedure_code.py:148,vendor/ngap/protocol_ie.py:120). A role there would print as raw markup in a user's traceback, so it stays bare — the same reasoning that excludes theSchemaErrorf-string in docs(schema): convert bare citations to the issue role in docstrings #1004.Regeneration is a no-op, evidenced without running a crawler: 37 of the 38 const role sites have a vendor template origin, and for each of
ftp/command,http/methodandreg/apptype/apptypethe ordered list of (issue number, line text) is equal on both sides after unescaping{{/}}— 12, 11 and 14 sites. The one exception,const/ngap/__init__.py:23, is hand-written with different prose from its vendor counterpart and was converted directly. Only the ngap, ipv6 extension-header and ipx-socket modules have byte-for-byte regeneration tests;ftp,httpandapptypedo not, which is why the text equality is the evidence.Two existing assertions updated.
tests/const/test_const_method_value_lookup_908_unit.py:326,341asserted the literal'GitHub issue #908'against the generated source, pinning the citation form this ruling changes. They now accept either form viaassertRegex, so a future markup change does not break them again; the companionsource in renderedassertion still pins the vendor and const text to each other exactly. The module's own prose is untouched — that belongs to #719'stests/sweep.Also checked: 0 roles nested inside
**…**,*…*or``…``— the defect class found on #1004, which renders as literal markup with no Sphinx warning. Docs build warning sets identical before and after.