Skip to content

Commit

Permalink
detritus: provide an example R CMD check NOTE
Browse files Browse the repository at this point in the history
  • Loading branch information
aitap committed Nov 20, 2024
1 parent 5687d14 commit 4dd0a62
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions code_issues.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,12 @@ If you use `tempfile()`/`tempdir()` as the default destination for functions cal

### Details

::: {.callout-note title="CRAN NOTE" icon=false}
Check: for detritus in the temp directory, Result: NOTE\
  Found the following files/directories:\
   ‘this\_is\_detritus382e569a7712’
:::

The code responsible for the detritus may include your own tests and examples creating files under `tempdir()`, child processes, or 'Python' code launched using 'reticulate'. For example, R packages that use the 'tensorflow' 'Python' package [find and remove temporary files created by its auto-gradient feature](https://github.com/cran/vetiver/blob/35b24768cf0e84fab96610e001bba377dc777953/tests/testthat/setup.R#L13).

A package that uses the 'testthat' test suite will benefit from [the self-cleaning functions `withr::local_tempfile()` and `withr::local_tempdir()`](https://r-pkgs.org/testing-design.html#sec-tests-files-where-write) to work with temporary files. Even without 'testthat', the 'withr' package has no external strong dependencies and can be used independently.
Expand Down

0 comments on commit 4dd0a62

Please sign in to comment.