Skip to content

docs: Break lines at meaning boundaries - #195

Closed
krlmlr wants to merge 3 commits into
r-lib:claude/badge-harmonizationfrom
krlmlr:claude/sembr
Closed

docs: Break lines at meaning boundaries#195
krlmlr wants to merge 3 commits into
r-lib:claude/badge-harmonizationfrom
krlmlr:claude/sembr

Conversation

@krlmlr

@krlmlr krlmlr commented Sep 13, 2026

Copy link
Copy Markdown
Member

Superseded by #199, which is the same branch opened with its head in this repository so that it can join the pull request stack. Continue there.

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

-#' `here()` uses reasonable heuristics to find your project's files, based on
-#' the current working directory at the time when the package is loaded.
+#' `here()` uses reasonable heuristics to find your project's files,
+#' based on the current working directory at the time when the package is loaded.

man/ is left to CI

man/*.Rd is not committed here. roxygen2 passes source line breaks straight 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, and the diff stays prose only.

The rendered help does not move either way: every topic was compared with tools::Rd2txt() before and after and is byte-identical. Same for the README — rendered twice, byte-identical both times, and the README.md/index.md diffs contain only line breaks.

What was left alone

  • Blocks that already conform. A good deal of this package was already written this way; those are untouched, and the rest now matches them.
  • R/aaa.R — its prose lives in string literals inside paste(..., sep = "\n") that build the \section{Project root} fragment. That is code, and re-breaking it would change generated output.
  • Code inside chunks, @examples, and YAML front matter.
  • Two vignette lines remain at 142 columns; both overrun only because of an embedded URL, which the convention exempts, and the only break points available would split inside a link.

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 #197, 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.

This is the first of a fleet-wide pass and the one I reviewed by hand before running the rest, so it is the right place to push back on the convention or the mechanics if either looks wrong.

🤖 Generated with Claude Code

https://claude.ai/code/session_01WWhverMTZZKgEpUuTK117m


Generated by Claude Code

This was referenced Sep 13, 2026
@krlmlr
krlmlr force-pushed the claude/badge-harmonization branch from 7293653 to 0164654 Compare September 13, 2026 16:55
krlmlr and others added 3 commits September 13, 2026 20:35
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 in roxygen blocks now carry two spaces after the
comment marker instead of one, so that a sentence which starts on its
own line keeps a full sentence gap in the rendered help.

In this package the rendered help is unchanged, and man/*.Rd is not
regenerated at all: the package sets `Roxygen: list(markdown = TRUE)`,
and in markdown mode roxygen2 strips the leading whitespace of every
continuation line before it reaches the .Rd. The indent is therefore
source style only here, kept for consistency with the packages where it
does carry the gap.

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`.
This package sets `Roxygen: list(markdown = TRUE)`,
and commonmark strips the leading whitespace of a continuation line before roxygen2 writes the topic.

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