Skip to content

docs: Break lines at meaning boundaries - #751

Merged
krlmlr merged 6 commits into
claude/badge-harmonizationfrom
claude/sembr
Sep 13, 2026
Merged

krlmlr merged 6 commits into
claude/badge-harmonizationfrom
claude/sembr

Conversation

@krlmlr

@krlmlr krlmlr commented Sep 13, 2026 •

Copy link
Copy Markdown
Member

Reformatting only, no wording changes. Prose in README.Rmd, seven 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.

68 of 161 R/ files needed work; the other 93 had no multi-line prose to rewrap. spec.Rmd is untouched — it is front matter and one chunk.

A sentence that spans more than one line starts at the beginning of a line, and so does the sentence after it. A sentence that fits on one line may still share that line with its neighbours. The very long joined lines an earlier revision of this branch carried — the longest at 461 columns — are gone again: nothing under R/ now exceeds the 140-column ceiling.

man/ is left to CI

man/ is not part of this pull request. Every commit in the chain leaves the .Rd files byte-identical to main, and CI regenerates and commits them after merge, so what is under review here is the sources alone.

Verification

  • Word-level identity for every file touched: comment markers stripped, whitespace collapsed, compared — nothing reworded, added or dropped.
  • Pandoc-rendered HTML of every .Rmd, before vs. after — byte-identical.
  • render_readme() run twice — byte-identical both times.
  • air format . — no further changes; every R/ file parses.

One consequence, stated plainly

A line break which follows the end of a sentence currently renders as one space, not 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 #754, stacked on top of this chain, and can be taken or left on its own. Without it, this change renders as the package renders today, minus that gap.

Left alone

  • man-roxygen/methods.R — five lines of tags and an \Sexpr, no prose.
  • vignettes/spec.md and spec.html — generated from DBItest.
  • NEWS.md, tests, @examples, code chunks, \preformatted and indented blocks, YAML front matter.
  • A few lines over 140 columns whose overrun is a single long URL, per the convention's exception — one in DBI-history.Rmd, the resources list in DBI-proposal.Rmd.

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 6 commits September 13, 2026 20:28
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.

`Config/roxygen2/version` moves to 8.1.0.9000, the version that
regenerated these files and the one the rest of the fleet already
pins. It is the only non-prose change here.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WWhverMTZZKgEpUuTK117m
Amendment to the semantic line break pass: when a sentence has to span
more than one line, that sentence and the one after it each start at
the beginning of a line.

Where two sentences are separated by two spaces, no line break can
survive: Rd2txt() renders the gap literally, and roxygen2 strips
leading whitespace from continuation lines, so breaking there would
drop a space from the rendered help. Those sentences are joined onto
one long line instead. A line over 140 columns changes nothing a reader
sees; a break at the double space would.

Reformatting only, no wording changes. 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 all 69
topics.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WWhverMTZZKgEpUuTK117m
Inside a roxygen block the first line of a paragraph, and every tag line,
keeps one space after `#'`; every continuation line of that paragraph now
has two. The paragraph structure of the source becomes visible without
reading ahead, and in packages that do not enable roxygen2 markdown the
extra space is what carries a sentence gap across a line break.

DBI enables markdown (`Roxygen: list(markdown = TRUE)`), and commonmark
strips leading whitespace from a paragraph's continuation lines, so here
the indent reaches neither `man/*.Rd` nor the rendered help. Nothing is
regenerated: roxygen2 writes no file, and `tools::Rd2txt()` is unchanged
for all 69 topics.

That also means the long lines this pass created cannot come apart again.
Where two sentences are separated by two spaces, the pair still has to
share one line -- under markdown no leading-space, trailing-space or
hard-break form survives into the `.Rd`, so breaking there would drop a
space from the rendered help.

Reformatting only, no wording changes: the words either side of the diff
are identical once comment markers and whitespace are collapsed.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WWhverMTZZKgEpUuTK117m
The two-space continuation indent never reached the `.Rd`. DBI 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.

The sentence gap it was meant to carry now comes from roxygen2 itself
(krlmlr/roxygen2#8), which indents the line break after a sentence at the
point where the break is emitted. The source-level indent is redundant, so
it comes out.

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, and the roxygen2 fix is what will eventually let them
come apart.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WWhverMTZZKgEpUuTK117m
The long joined lines existed to protect a sentence gap:
two spaces after a sentence period are content, Rd2txt() renders them literally, and a line break there drops one of them.
Joining the sentences onto one line was the only way to keep the gap.

The joins come out, so every sentence starts its own line again.

Reformatting only, no wording changes.

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 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WWhverMTZZKgEpUuTK117m
@krlmlr
krlmlr merged commit e9cda24 into main Sep 13, 2026
7 of 11 checks passed
@krlmlr
krlmlr deleted the claude/sembr branch September 13, 2026 20:40
@krlmlr krlmlr mentioned this pull request Nov 28, 2026
3 of 7 tasks
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.

2 participants