Repository navigation
Conversation
dc8e2f4 to
c33a33c
Compare
c33a33c to
907d215
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 <[email protected]> Claude-Session: https://claude.ai/code/session_01WWhverMTZZKgEpUuTK117m
…l escape The version stamp passed `"\1"` as the replacement in the `sub()` call that derives the `.9100` build number. R parses `"\1"` in a string literal as the octal escape for `\001`, not as a regex backreference, so `DESCRIPTION` received a control character where the `x.y.z` prefix belonged, and `R CMD INSTALL` aborted with "Malformed package version". The replacement is now `"\\1"`, which reaches the regex engine as a backreference and stamps `8.1.0.9000` to `8.1.0.9100`. The post-install guard asserted only the `.9100` suffix, which the corrupt `"\001.9100"` also satisfies. That is why the bug survived the very check that was 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 <[email protected]> Claude-Session: https://claude.ai/code/session_01WWhverMTZZKgEpUuTK117m
ad7af65 to
f3e9e4d
Compare
|
Review of this PR at 3289d28, by a Claude Code reviewer with clean context that read the two hand-written commits (17c10ac, f3e9e4d), ran the action's clone, merge-base, diff, High1. The new step is the only unguarded step in that part of the smoke test, so any failure in it stops Medium2. The job executes code from a mutable branch of a personal fork with a write token. By reading: the defaults at 3. Upstream is taken at its moving tip with a 50-commit window, and both have already drifted. Confirmed: today upstream 4. GitHub reports the PR as not mergeable because of one conflict in 5. The step is added to the shared workflow file instead of the repository's hook. By reading: Low6. Anyone documenting locally with stock roxygen2 reverts the change, and roxygen2 does not stop them. By reading upstream at c0ba461: when the installed version is older than 7. The inputs are interpolated straight into the shell script. By reading: 8. Two comments do not match what the code does. Confirmed: the patch touches two hunks of Checked and found sound
Generated by Claude Code |
…/roxygen2-fork Keep the Config/cynkra/roxygen2 field, and set Config/roxygen2/version to 8.1.1.9100, which is what the action stamps onto upstream 8.1.1.9000. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Hr1rd3gjmufoKCWVDBPCgE
Pin both sides to full commit SHAs and fetch them by SHA, so a push to the fork's branch cannot change what the job runs with a write token. Fetch the history without file contents, so finding the branch point no longer depends on a 50-commit window. Retry the two network fetches. Pass the inputs through `env:` instead of interpolating them into the script. Stamp the version with a single-line edit of `Version:` instead of rewriting DESCRIPTION with `write.dcf()`, which lost the `Authors@R` indentation, and correct the comment on the size of the patch. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Hr1rd3gjmufoKCWVDBPCgE
Call the action from `custom/after-install` instead of editing `R-CMD-check.yaml`, which fleet-wide syncs keep rewriting. The hook runs before Roxygenize. The step has `continue-on-error`, so a failed install no longer stops the other checks. Roxygenize is skipped when it failed, and the outcome is listed in "Collect the outcomes of the checks", so the job still goes red. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Hr1rd3gjmufoKCWVDBPCgE
The after-install hook is called by `rcc-smoke`, `rcc-full` and `rcc-suggests`. Only `rcc-smoke` runs Roxygenize, so the other jobs built the patched roxygen2 for nothing and gained a failure surface. Restrict the install and the outcome record to `github.job == 'rcc-smoke'`. An unset `ROXYGEN2_FORK_OUTCOME` is not `failure`, so nothing else changes. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Hr1rd3gjmufoKCWVDBPCgE
Accepted limitationsFindings 1 to 5, 7 and 8 of the review above are fixed in aafd9d5 (merge,
Generated by Claude Code |
|
Closing: the decision is to stay with stock roxygen2. The work, including the review fixes, remains on the branch Generated by Claude Code |
Stacked on #788, which this pull request targets. It does not depend on it, and can be retargeted to
mainso that it is decided on its own and CI runs on it.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. That is what forced the very long single roxygen lines this package used to carry, because 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 of the fork branchkrlmlr/roxygen2@f-sentence-spacingapplied on top. The repository's own hook,.github/workflows/custom/after-install, runs it in thercc-smokejob only, before the Roxygenize step; the other jobs do not document and skip it. The step runs withcontinue-on-error: if the install fails,R-CMD-check.yamlskips Roxygenize and lists the failure in the check summary, so the other checks still run.The action fetches upstream and the fork by pinned full commit SHAs (
upstream-shaandfork-sha, which move together in a reviewed commit), with history but without file contents, and retries the fetches. It computes the diff against their merge base restricted toR/, 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.1.9100: upstream's 8.1.1.9000 with the.9100suffix, which distinguishes a patched build from upstream's own.9000development builds. The suffix is stamped with a single-line edit of roxygen2'sVersion:field.DESCRIPTIONis DCF and cannot carry a comment line, sinceread.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 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. The.Rdfiles are generated output, so CI roxygenises and commits them itself; 16 regenerated.Rdfiles are part of this pull request's diff as an automated commit, and the hand-written half stays reviewable on its own.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.Review
A clean-context review found one High and four Medium issues, all fixed; what remains is listed under Accepted limitations, most importantly that nothing of the new setup has run in CI yet.
🤖 Generated with Claude Code
https://claude.ai/code/session_01Hr1rd3gjmufoKCWVDBPCgE