Conversation
krlmlr
added this pull request to stack #256
September 13, 2026 21:48
krlmlr
force-pushed
the
claude/roxygen2-fork
branch
from
September 13, 2026 21:48
d2d13fb to
efdb5a1
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
The version stamp passed "\1" to `sub()` as the replacement, meaning it as a backreference to the captured `x.y.z`. R parses `"\1"` in a string literal as the octal escape for `\001`, so the stamped version became a control character followed by `.9100`, and `DESCRIPTION` was left with a malformed version. `R CMD INSTALL` aborted on it, which is what turned this action red across every pull request that runs it. 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"` ends in `.9100` as well, so the guard passed and the bug survived unnoticed. It now asserts the whole `x.y.z.9100` shape, and passes `inherits = FALSE` to `exists()` so the patch check cannot be satisfied from a parent environment. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WWhverMTZZKgEpUuTK117m
krlmlr
force-pushed
the
claude/roxygen2-fork
branch
from
September 14, 2026 05:57
ca81eac to
e69bf0d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replaces #250, which had its head on a fork and so could not join the pull request stack. Same branch, same commits.
Split out of #247 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 kept several roxygen blocks on single very long lines — joining was the only way to keep the gap.
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.The diff is exactly three paths: the action, the two-line step in
R-CMD-check.yaml, andDESCRIPTION.Why it is a separate pull request
Taking it changes rendered help across the package; leaving it means the reformatting below renders exactly as the package renders today, with one space between sentences. Neither half needs the other to be correct, so they should be able to be decided separately.
man/is not edited by hand here, nor anywhere else in the chain. TheCommit and push the generated changesstep after Roxygenize regenerates and commits the.Rdfiles, so they arrive on these branches as automated commits rather than in the hand-written diffs, which stay reviewable.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