Skip to content

Commit 6879d20

Browse files
Merge pull request #819 from lorenzwalthert/issue-818
- use R.cache >= 0.15.0 and avoid the prompt (#819).
2 parents 516fcf6 + fe0d54a commit 6879d20

File tree

4 files changed

+10
-49
lines changed

4 files changed

+10
-49
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Imports:
2121
cli (>= 1.1.0),
2222
magrittr (>= 2.0.0),
2323
purrr (>= 0.2.3),
24-
R.cache (>= 0.14.0),
24+
R.cache (>= 0.15.0),
2525
rematch2 (>= 2.0.1),
2626
rlang (>= 0.1.1),
2727
rprojroot (>= 1.1),

NEWS.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@
6868
* `exclude_dirs` in `style_pkg()` is now properly respected if it is a
6969
sub-directory of a directory that is scheduled for styling (e.g.
7070
`test/testthat/some/dir`) (#811).
71+
* the user is not prompted anymore to confirm the creation of a permanent cache
72+
as R.cache >= 0.15.0 uses a standard location in line with CRAN policies
73+
(#819).
7174
* R code chunks in nested non-R chunks in R markdown don't yield an error
7275
anymore when document is styled, chunks are still not styled (#788, #794).
7376
* `cache_activate()` and `cache_deactivate()` now respect the R

R/ui-caching.R

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -32,27 +32,10 @@ cache_clear <- function(cache_name = NULL, ask = TRUE) {
3232
#' Since we leverage `{R.cache}` to manage the cache, you can also use any
3333
#' `{R.cache}` functionality to manipulate it.
3434
#'
35-
#' @section Interactive setup:
36-
#' `{styler}` by default uses caching via the `{R.cache}` package. When interacting
37-
#' with `{styler}`, you will be asked to let it create a permanent cache on your
38-
#' file system that styler will use in case it is not set already up for another
39-
#' tool that uses `{R.cache}`. We encourage users to let `{R.cache}` create a
40-
#' permanent directory for caching because, otherwise, the cache is lost at
41-
#' restart of R.
42-
#'
43-
#' @section Non-interactive setup:
44-
#' In some cases, you want to avoid the interactive prompt described above. In
35+
#' In some cases, you want to use a non-standard cache location. In
4536
#' that situation, you can set the path to the cache with the R option
4637
#' `R.cache.rootPath` or the environment variable `R_CACHE_ROOTPATH` to an
47-
#' existent path before you call the styler API. This should avoid the prompt.
48-
#' `R.cache::setCacheRootPath("/path/to/cache")` is also programmatic but will
49-
#' probably give the prompt anyways if called interactively.
50-
#'
51-
#' @section Non-interactive use:
52-
#' Note that if you have never authorized `{R.cache}` to create the cache in a
53-
#' permanent directory and you use `{styler}` non-interactively, it will build the
54-
#' cache in a temporary directory. To create a permanent cache, follow the
55-
#' section 'Non-interactive setup' or 'Interactive setup' above.
38+
#' existent path before you call the styler API.
5639
#'
5740
#' @section Invalidation:
5841
#' The cache is specific to a version of styler by default, because different
@@ -67,8 +50,7 @@ cache_clear <- function(cache_name = NULL, ask = TRUE) {
6750
#' @section Using a cache for styler in CI/CD:
6851
#' If you want to set up caching in a CI/CD pipeline, we suggest to set the
6952
#' `{R.cache}` root path to a directory for which you have the cache enabled as
70-
#' described above in the section 'Non-interactive setup'. This can often be set
71-
#' in config files of CI/CD tools, e.g. see the
53+
#' This can often be set in config files of CI/CD tools, e.g. see the
7254
#' [Travis documentation on caching](https://docs.travis-ci.com/user/caching).
7355
#'
7456
#' @name caching

man/caching.Rd

Lines changed: 3 additions & 27 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)