Skip to content

[CRAN feedback] Eliminate unsafe file writing: use tempdir() for all examples, vignettes, and tests #9

@villegar

Description

@villegar

Summary:

  • CRAN prohibits by-default writing to the user's home filespace, the package directory, or the working directory (getwd()) in examples, vignettes, or tests.

Feedback references:

Initial code review findings:

  • In R/report.R, the default for file outputs is already tempfile(), but please confirm/extend this pattern in all user-writable function parameters.
  • All examples, vignettes, and test code that writes files should explicitly use tempdir() (never package root, never working directory unless set within a temp directory).
  • The vignette file deploy-local-datashield-server-with-opal.Rmd appears not to write output, but all future/output code must use tempdir() as root for all paths.

Checklist:

  • Audit all file writing paths in R/, examples, vignettes, and tests
  • Replace/force all file writing to use tempdir() or tempfile()
  • Never write files in package root, home directory, or getwd()
  • Add test to confirm forbidden file paths are not used by default
  • Document with code comments as needed

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions