Skip to content

docs: Break lines at meaning boundaries - #873

Open
krlmlr wants to merge 4 commits into
claude/badge-harmonization-2from
claude/sembr-2
Open

docs: Break lines at meaning boundaries#873
krlmlr wants to merge 4 commits into
claude/badge-harmonization-2from
claude/sembr-2

Conversation

@krlmlr

@krlmlr krlmlr commented Sep 13, 2026

Copy link
Copy Markdown
Member

Supersedes #869, re-cut so it stacks on #872.

Reformatting only, no wording changes. Prose in README.Rmd, two of the five vignettes, and the roxygen and inline comments under R/ now breaks at sentence and clause boundaries rather than wrapping to a fixed width.

The payoff is sentence-level diffs. A reworded sentence touches one line instead of reflowing the paragraph around it, so review sees the change and not the rewrap.

Verification

  • tools::Rd2txt() over all 36 topics — byte-identical.
  • README rendered twice — byte-identical both times.
  • Every added and removed line under R/ was checked mechanically to be a comment line, so no code moved.

debugme, digits and numbers needed nothing — already conforming.

Re-rendering this branch after the rebase onto #872 produced zero changes.

man/ is left to CI

man/*.Rd is not committed here. roxygen2 passes source line breaks through to the .Rd, so reformatting the sources does move the generated files — but they are generated output, and the Commit and push the generated changes step after Roxygenize regenerates and commits them once this merges. man/ therefore ends this branch byte-identical to main, which is what keeps this diff prose only rather than twice its size.

Left alone

  • The clean_output() chunk hook, including the dataframe_N_N and ___row_number suppressions.
  • Vendored rlang files, which are refreshed wholesale from upstream so reformatting would create permanent drift: R/compat-lifecycle.R, R/compat-purrr.R, R/register-s3.R.
  • A paragraph in R/options.R where default: 20. and default: 3. are followed by two spaces. Rd2txt() renders that literally, so breaking at those sentence boundaries collapsed it and failed the check; the bullets were rebroken at the preceding comma instead, leaving the double space mid-line.

The continuation indent is added and taken back out

The second commit gave every continuation line of a roxygen paragraph a second space after the #' marker, and the third commit reverts it. The net effect of this PR is the line-breaking described above and nothing else.

The indent never reached the .Rd. This package sets Roxygen: list(markdown = TRUE), and roxygen2 strips the leading whitespace of a continuation line during the commonmark parse, so man/ and NAMESPACE came back byte-identical with the indent and without it.

The third commit is a git revert rather than a substitution, because the indent pass had also normalised pre-existing three-space tag continuations down to two and those have to go back to three. git diff between the commit before the indent and the branch tip is empty. The R/options.R pair above is untouched throughout, and no line is joined or broken by either of the two commits.

The sentence gap

A line break which follows the end of a sentence currently renders as one space rather than two, so writing one sentence per line drops the sentence gap from the rendered help. Restoring it needs a patched roxygen2, which is a separate decision: it is #875, stacked on top of this chain, and can be taken or left on its own. Without it this change simply renders as the package renders today, and the long joined lines stay as they are.

Part of a fleet-wide pass. r-lib/here#195 is the reference PR, reviewed by hand before the rest were run.

🤖 Generated with Claude Code

https://claude.ai/code/session_01WWhverMTZZKgEpUuTK117m

krlmlr and others added 3 commits September 13, 2026 23:27
Reformatting only, no wording changes: prose in README.Rmd, the
vignettes and the roxygen and inline comments under R/ now breaks at
sentence and clause boundaries rather than wrapping to a fixed width.

The payoff is sentence-level diffs. A reworded sentence touches one
line instead of reflowing the paragraph around it, so review sees the
change and not the rewrap.

man/*.Rd is regenerated because roxygen2 passes source line breaks
through to the .Rd. The rendered help is byte-identical -- checked with
tools::Rd2txt() over every topic -- as is the rendered README.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WWhverMTZZKgEpUuTK117m
Continuation lines of a roxygen paragraph now carry two spaces after the
`#'` marker instead of one.
The first line of a paragraph and every tag line keep their single space,
so the indent marks exactly where a line break continues a paragraph.

The point of the indent is that `Rd2txt()` renders a line break followed by
indentation as two spaces and a bare line break as one,
so a sentence gap survives being broken across lines.
This package sets `Roxygen: list(markdown = TRUE)`,
and roxygen2 strips the leading whitespace of a continuation line during the
commonmark parse,
so here the indent reaches the source only:
`man/*.Rd` is byte-identical and so is the rendered help.
No line was joined or broken in this commit.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WWhverMTZZKgEpUuTK117m
The two-space continuation indent never reached the `.Rd`. pillar sets
`Roxygen: list(markdown = TRUE)`, and commonmark strips the leading
whitespace of a continuation line before roxygen2 writes the topic, so the
indent changed no rendered output -- `man/` was byte-identical with it and
without it.

This is `git revert` of the indent commit, not a substitution: that pass also
normalised pre-existing three-space tag continuations down to two, and the
revert puts them back at three.

The long joined lines the sembr pass created stay as they are. Undoing those
is a separate decision.

man/ is left to CI, which regenerates it from these sources.

A line break which follows the end of a sentence currently renders as one space rather than two.
Restoring that gap needs a patched roxygen2, which is a separate decision and a separate pull request,
so it is deliberately not part of this change.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WWhverMTZZKgEpUuTK117m
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant