ThinkR-open / checkhelper

A package to help deal with devtools::check outputs
https://thinkr-open.github.io/checkhelper/
Other
34 stars 4 forks source link

Check that my package dont write in the user's home filespace, package directory and getwd(). #13

Closed statnmap closed 1 year ago

statnmap commented 3 years ago

Critères de validation

Screenshot 2023-01-25 at 16 52 46

Comment technique

To be continued...

local <- utils::fileSnapshot (".", timestamp = tempfile("timestamp"), md5sum = TRUE)
home <- utils::fileSnapshot ("~", timestamp = tempfile("timestamp"), md5sum = TRUE)

# run tests or whatever, then ...
# x <- autotest::autotest_package(test = TRUE)
devtools::test()
devtools::run_examples()
# vignettes
dircheck <- tempfile("check")
dir.create(dircheck)
rcmdcheck::rcmdcheck(check_dir = dircheck)
# browseURL(dircheck)

the_dir <- list.files(file.path(dircheck), pattern = ".Rcheck", full.names = TRUE)
# Same tests, no new files
all(list.files(file.path(the_dir, "tests", "testthat")) %in%
list.files(file.path(".", "tests", "testthat")))

devtools::build_vignettes()
devtools::clean_vignettes()

utils::changedFiles(local, md5sum = TRUE)
utils::changedFiles(home, md5sum = TRUE)
statnmap commented 1 year ago

je valide