Repository navigation
fix: align rfc-index.txt continuation lines with the title - #11964
jennifer-richards merged 2 commits into
Conversation
Indent each continuation line by the width of the RFC number plus one, so wrapped text lines up under the title for RFC numbers of any length. Update the citation format example in the file header to match. Fixes ietf-tools#11896
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #11964 +/- ##
=======================================
Coverage 89.04% 89.05%
=======================================
Files 342 342
Lines 46590 46632 +42
=======================================
+ Hits 41488 41528 +40
- Misses 5102 5104 +2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Hi, thank you for the contribution. Please have a look at our Contribution guidelines, particularly the section about using AI coding agents. Can you confirm that a human has reviewed and understands the work contributed? On this particular work, the "Continuation lines are indented..." line added to the header is not needed. If you can take that out, the rest of the patch looks acceptable. Thanks! |
|
Yes, I've reviewed this change and understand it: continuation lines now start under the title (the number's width + 1), legacy 4-digit output is unchanged, and the test covers 2-, 4- and 5-digit numbers. The header line you mentioned was removed in d4283fd. |
Thanks, and thanks for the contribution |
Fixes #11896
This implements option 2 from the issue, which was chosen in the issue comments: each continuation line in
rfc-index.txtis now indented to start under the first letter of the title. Before this change it was always indented 5 spaces.Before:
After:
Changes:
ietf/sync/rfcindex.py: inget_rfc_text_index_entries(), setsubsequent_indentto the length of the formatted RFC number plus one. IfRFCINDEX_MATCH_LEGACY_XMLis on (four-digit zero-padded numbers), this is still 5 spaces, so legacy output does not change.ietf/templates/sync/rfc-index.txt: the issue asks for the header example to match the real format. The format block used two spaces after the number and between fields, and an 8-space continuation. Neither matches the generated entries. I changed it to the single-space layout the file actually uses, with continuation lines under the title, and added one sentence saying continuation lines are indented to line up with the title. The9915example was already correct and is unchanged. If you want the header kept as it was, I can drop this part.ietf/sync/tests_rfcindex.py: new testtest_rfc_text_index_entry_continuation_indent. It builds entries for a 2-digit, a 4-digit and a 5-digit RFC and checks that every continuation line is indented exactly to the start of the title.Testing:
ietf/manage.py test --settings=settings_test ietf.sync.tests_rfcindex: all 16 tests pass. The new test fails onmainwithout the fix: the 2-digit RFC's continuation has 5 spaces, but 3 were expected.ruff check --select Fon the two changed Python files: clean.I ran the tests outside the dev container, against a local PostgreSQL with a few local-only shims: no system-path checks, a stub for weasyprint/libmagic, and
--skip-coverage. None of these are in the commit. I have not run the full test suite. CI is the real check there.