Skip to content

fix: align rfc-index.txt continuation lines with the title - #11964

Merged
jennifer-richards merged 2 commits into
ietf-tools:mainfrom
thisisshivamtiwari:fix/rfc-index-continuation-indent
Oct 30, 2026
Merged

jennifer-richards merged 2 commits into
ietf-tools:mainfrom
thisisshivamtiwari:fix/rfc-index-continuation-indent

Conversation

@thisisshivamtiwari

Copy link
Copy Markdown
Contributor

Fixes #11896

This implements option 2 from the issue, which was chosen in the issue comments: each continuation line in rfc-index.txt is now indented to start under the first letter of the title. Before this change it was always indented 5 spaces.

Before:

99 Title...
     Continued on the next line

10000 Title...
     Continued on the next line

After:

99 Title...
   Continued on the next line

10000 Title...
      Continued on the next line

Changes:

  • ietf/sync/rfcindex.py: in get_rfc_text_index_entries(), set subsequent_indent to the length of the formatted RFC number plus one. If RFCINDEX_MATCH_LEGACY_XML is 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. The 9915 example 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 test test_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 on main without the fix: the 2-digit RFC's continuation has 5 spaces, but 3 were expected.
  • ruff check --select F on 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.

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

codecov Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.05%. Comparing base (0ee9354) to head (d4283fd).
⚠️ Report is 5 commits behind head on main.

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.
📢 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
@jennifer-richards

Copy link
Copy Markdown
Member

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!

@thisisshivamtiwari

Copy link
Copy Markdown
Contributor Author

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.

@jennifer-richards
jennifer-richards merged commit fecb533 into ietf-tools:main Oct 30, 2026
8 checks passed
@jennifer-richards

Copy link
Copy Markdown
Member

Yes, I've reviewed this change and understand it

Thanks, and thanks for the contribution

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Nov 3, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

2 participants