Diagnose Writes Outside the Temporary Directory in Examples
Source:R/diagnostics-examples.R
lab_example_writes.RdFlags a write from an example, vignette or demo whose destination is a literal
path, so it lands in the user's filespace rather than in tempdir(). A
destination the caller supplies is permission and is not flagged.
Value
checktor_check_result() with passed, issues, message.
Source
The CRAN Cookbook covers this under
Writing Files and Directories to the Home Filespace,
and the rejection reads "Please ensure that your functions do not write by
default or in your examples/vignettes/tests in the user's home filespace". See
vignette("check-sources", package = "checktor") for how every check maps to its
source.
See also
checktor(), lab_file_operations() for the same rule in R/.
Examples
pkg <- example_diagnose_scenario("code_examples/tf_usage_bad.R",
show_content = FALSE)
lab_example_writes(pkg, verbose = FALSE)$passed
#> [1] TRUE