Conversation
|
This is how benchmark results would change (along with a 95% confidence interval in relative change) if 35426dc is merged into claude/readme-rmd:
|
33adc59 to
840234c
Compare
|
This is how benchmark results would change (along with a 95% confidence interval in relative change) if 33adc59 is merged into claude/readme-rmd:
|
|
This is how benchmark results would change (along with a 95% confidence interval in relative change) if 840234c is merged into claude/readme-rmd:
|
840234c to
2a68aa0
Compare
commonmark discards the whitespace a line break stands for, so roxygen prose written one sentence per line loses the gap between sentences in the rendered help. Only the text renderer is affected, which is what `?topic` shows. A new composite action installs roxygen2 from upstream with the R/ part of krlmlr/roxygen2@f-sentence-spacing applied on top, and runs just before the Roxygenize step. It shallow-clones upstream, fetches the branch, applies the diff restricted to R/ so conflicts in the test files cannot fail it, and aborts rather than silently installing an unpatched build. It then asserts that what it installed really carries the patch. Config/roxygen2/version becomes 8.1.0.9100. The .9100 suffix distinguishes a patched build from upstream's own .9000 development builds; if upstream moves, the x.y.z part follows it and the suffix stays. DESCRIPTION is DCF and cannot carry a comment, so the explanation lives in a Config/cynkra/roxygen2 field. This is a separate decision from the line-break reformatting below it, and is kept in its own pull request so it can be taken or left on its own. Without it, the reformatting simply renders as it does today, with one space between sentences. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WWhverMTZZKgEpUuTK117m
2a68aa0 to
cb1d208
Compare
|
This is how benchmark results would change (along with a 95% confidence interval in relative change) if cb1d208 is merged into claude/readme-rmd:
|
…l escape The version stamp wrote the replacement as "\1". R parses that as the octal escape for \001, not as a regex backreference, so DESCRIPTION ended up with a malformed version and R CMD INSTALL aborted with "Malformed package version". Every job that installs roxygen2 through this action failed there. The replacement is now "\\1", verified to stamp 8.1.0.9000 to 8.1.0.9100. The post-install guard asserted only the .9100 suffix, and the corrupt "\001.9100" satisfies that too, which is why the bug survived the check meant to catch it. The guard now asserts the whole x.y.z.9100 shape, and passes inherits = FALSE to exists(). Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WWhverMTZZKgEpUuTK117m
|
This is how benchmark results would change (along with a 95% confidence interval in relative change) if c3533b7 is merged into claude/readme-rmd:
|
|
I'd like to hear more on the use case of this. |
|
Happy to. The concrete use case is making semantic line breaks usable in roxygen comments without silently degrading Today the two things are mutually exclusive. commonmark discards the whitespace a line break stands for, so roxygen2 emits a bare newline and That trade-off is what shaped the reformatting in #2903. It is why this package still carries long single-line roxygen paragraphs, and why that pass had to leave 26 places joined: splitting them would have kept the prose readable in the source only at the cost of losing the gap, and keeping the gap meant leaving lines of 1440 and 973 characters in place. The effect is measured rather than assumed. Running The cost is real and worth stating plainly: it documents with a roxygen2 that carries a patch not yet filed with r-lib. Nothing is vendored into the repo — CI installs upstream and applies the Which is why it is split out rather than folded into #2903. If you would rather not carry a patched documentation toolchain, #2903 stands on its own: the rendered help then matches what the package renders today everywhere except those 80 gaps. If the gap matters more than the patch costs, this one makes the reformatting lossless. Either way is coherent — I would rather you pick than have it decided by which pull request merges first. Generated by Claude Code |
Split out of #2903 so it can be decided on its own.
The problem
commonmark discards the whitespace a line break stands for. roxygen2 turns every softbreak into a bare newline, so the
.Rdcarries a line break with nothing after it andRd2txt()renders it as a single space. Prose written one sentence per line therefore comes out single-spaced, while the same words wrapped to a fixed width with two spaces after the period keep the gap.That makes the two styles mutually exclusive: splitting a sentence pair separated by two spaces silently drops one of them. In this package that is what forced the long single-line roxygen paragraphs, and why the earlier reformatting pass had to leave 26 places joined — undoing them would have kept the gap only at the price of lines of 1440 and 973 characters.
Only the text renderer is affected.
Rd2HTML()andRd2latex()differ by whitespace that HTML and TeX collapse — and LaTeX applies its own sentence spacing regardless. But text is what?topicshows, so it is the version most people read.The change
A new composite action,
.github/workflows/roxygen2-fork, installs roxygen2 from upstream with theR/part ofkrlmlr/roxygen2@f-sentence-spacingapplied on top, andR-CMD-check.yamlruns it immediately before the Roxygenize step.It shallow-clones upstream, fetches the branch, computes the diff against their merge base restricted to
R/, and applies it withgit apply --3way. Restricting toR/means an unrelated upstream change to a test fixture cannot fail the documentation step. It aborts if the patch is empty or does not apply, rather than silently installing an unpatched build, and afterwards asserts that what it installed really carries the patch.Config/roxygen2/versionbecomes8.1.0.9100. The.9100suffix distinguishes a patched build from upstream's own.9000development builds; if upstream moves, thex.y.zpart follows it and the suffix stays.DESCRIPTIONis DCF and cannot carry a comment line —read.dcf()rejects one as malformed — so the explanation lives in aConfig/cynkra/roxygen2field.Why it is a separate pull request
Taking it changes rendered help across the package. Leaving it means the reformatting below renders as the package renders today everywhere except where a sentence pair separated by two spaces was split across lines:
tools::Rd2txt()over the 633 topics that branch regenerates finds 80 of them differing, each by that gap narrowing to a single space and by nothing else. Neither half needs the other to be correct, so they should be able to be decided separately.man/is not edited by hand here. The regenerated.Rdfiles are generated output, so CI roxygenises and commits them itself — they arrive on this branch as an automated commit rather than in the hand-written diff.Upstream
The roxygen2 side is
krlmlr/roxygen2#8, on the fork, not yet filed with r-lib. It is deliberately narrow: mid-sentence breaks are untouched, links are unaffected, and two guards keep it from firing wrongly — an abbreviation list so a line ending ine.g.oret al.does not gain a mid-sentence gap, and a fix for a determinism bug where a line starting with\doi{}or\code{}gained or lost its gap at random, because the test was reading roxygen2's own random placeholder for protected Rd tags.🤖 Generated with Claude Code
https://claude.ai/code/session_01WWhverMTZZKgEpUuTK117m
Generated by Claude Code