Skip to content

Address CRAN 0.2.0 reviewer feedback; bump to 0.2.1#5

Merged
TroyHernandez merged 2 commits intomainfrom
cran-0.2.1-fixes
Apr 22, 2026
Merged

Address CRAN 0.2.0 reviewer feedback; bump to 0.2.1#5
TroyHernandez merged 2 commits intomainfrom
cran-0.2.1-fixes

Conversation

@TroyHernandez
Copy link
Copy Markdown
Contributor

Summary

Addresses the CRAN reviewer feedback on 0.2.0:

  • References in DESCRIPTION. Added Wickham and Bryan (2023, ISBN:9781098134945) plus URLs for Writing R Extensions and the CRAN Repository Policy.
  • Executable examples. Rewrote most \dontrun{} examples to scaffold a throwaway package in tempdir() and actually run during R CMD check. The five that genuinely can't run (install, reload, check, check_win_devel, submit_cran) use \donttest{} + if (interactive()) with comments explaining why.
  • Write paths aligned with CRAN policy on the home filespace.
    • use_version() and use_github_action() now require an explicit path. They edit files under path, so tempdir() / R_user_dir() don't apply; the only CRAN-safe option is to force the caller to pass one.
    • build() now defaults dest_dir to tools::R_user_dir("tinypkgr", "cache") (e.g. ~/.cache/R/tinypkgr/ on Linux) — CRAN's recommended location for persistent per-package artifacts.

Also fixed

  • Internal system("R CMD ...") calls now go through file.path(R.home("bin"), "R") per Writing R Extensions 1.6. The bare-R bug was latent; only the new runnable examples exposed it.
  • ^\.claude$ added to .Rbuildignore so Claude Code's local state dir can't leak into a future tarball.

Checks

  • Local R CMD check --as-cran: 0 errors, 0 warnings, 0 notes (beyond the routine "New submission").
  • win-builder R-devel: 1 NOTE (spell-check on "Wickham" in the reference — routine for surnames).
  • All 38 tinytest tests pass.

Test plan

  • tinypkgr::check() clean locally
  • tinypkgr::check_win_devel() clean on win-builder
  • tinytest::test_package("tinypkgr") 38/38 passing

* DESCRIPTION: add reference URLs to 'Writing R Extensions' and the
  CRAN Repository Policy (reviewer asked for "references describing
  the methods ... or if those are not available: <https:...>").
* Examples: rewrite most \dontrun{} examples to be executable against
  a throwaway package scaffolded in tempdir(). The remaining
  non-runnable examples (install, reload, check, check_win_devel,
  submit_cran) use \donttest{} + if(interactive()) and explain why.
* Writing functions: remove default path. use_version() and
  use_github_action() now require an explicit path. build()'s
  dest_dir defaults to tempdir() instead of getwd().
* Internal: invoke R via file.path(R.home("bin"), "R") instead of
  bare 'R' on PATH (WRE 1.6 — surfaces only when examples are
  actually run under R CMD check).
* .Rbuildignore: add ^\.claude$ so Claude Code local state is not
  bundled into the tarball.
Retake on the file-write rule after re-reading the CRAN cookbook.
The rule isn't "writing functions must have no default" — it's that
a default must be tempdir(), an R_user_dir() cache/config/data path,
an explicit caller arg, or no default at all. Never the user's home
filespace (which includes getwd()).

* build(): dest_dir now defaults to tools::R_user_dir("tinypkgr",
  "cache") instead of ".". Tarballs persist in ~/.cache/R/tinypkgr/
  so they survive across sessions, and they're never in getwd().
* use_version() and use_github_action(): path required, no default.
  These edit files under path, so R_user_dir doesn't apply; the
  only CRAN-safe option is to force the caller to pass a path.
* DESCRIPTION: add Wickham and Bryan (2023, ISBN:9781098134945) to
  the references alongside the existing URLs.

NEWS.md and cran-comments.md updated to match. R CMD check --as-cran
passes with 0 errors, 0 warnings, and only the routine "New
submission" note.
@TroyHernandez TroyHernandez merged commit c6bbdd5 into main Apr 22, 2026
4 checks passed
@TroyHernandez TroyHernandez deleted the cran-0.2.1-fixes branch April 22, 2026 00:44
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