Skip to content

Prune stale tinyrox-generated Rd files during document() (#22)#26

Merged
TroyHernandez merged 2 commits into
mainfrom
issue-22-prune-rd
Jun 24, 2026
Merged

Prune stale tinyrox-generated Rd files during document() (#22)#26
TroyHernandez merged 2 commits into
mainfrom
issue-22-prune-rd

Conversation

@TroyHernandez

Copy link
Copy Markdown
Contributor

What

document() regenerates current Rd but never removed pages for topics that were renamed or deleted, leaving stale man/*.Rd that can trip R CMD check (it bit llm.api after renaming a provider helper).

document() now prunes stale Rd after regenerating — but conservatively:

  • A file is removed only if it's stale (setdiff(existing, generated)) and tinyrox can prove it owns it: line 1 is exactly the tinyrox marker.
  • Hand-written Rd, and Rd from other tools, are never touched.
  • New prune_rd argument (default TRUE); prune_rd = FALSE keeps the old keep-everything behaviour.
  • The returned list gains a pruned element.

The header marker is factored into a shared RD_MARKER constant used by both the generator and the new ownership check, so they can't drift.

Tests

test_prune.R covers the spec: stale tinyrox Rd removed, current Rd kept, hand-written Rd (no marker) kept, renamed topic leaves no orphan, and prune_rd = FALSE preserves the old behaviour.

Version bumped to 0.3.3.7. Full tinytest suite passes (204).

Closes #22

After regenerating, document() removes man/*.Rd pages it no longer produces (renamed or deleted topics), but only files tinyrox owns: line 1 must be the marker, now factored into a shared RD_MARKER constant so the generator and the ownership check cannot drift. Hand-written Rd, and Rd from other tools, are never touched. New prune_rd argument (default TRUE) gates it; prune_rd = FALSE keeps the old behaviour. The returned list gains a pruned element.
@TroyHernandez TroyHernandez merged commit 28bbd4f into main Jun 24, 2026
2 checks passed
@TroyHernandez TroyHernandez deleted the issue-22-prune-rd branch June 24, 2026 12:07
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.

Prune stale tinyrox-generated Rd files during document()

1 participant