Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use R.cache >= 0.15.0 and avoid the prompt #819

Merged
merged 1 commit into from
Jul 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Imports:
cli (>= 1.1.0),
magrittr (>= 2.0.0),
purrr (>= 0.2.3),
R.cache (>= 0.14.0),
R.cache (>= 0.15.0),
rematch2 (>= 2.0.1),
rlang (>= 0.1.1),
rprojroot (>= 1.1),
Expand Down
3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@
* `exclude_dirs` in `style_pkg()` is now properly respected if it is a
sub-directory of a directory that is scheduled for styling (e.g.
`test/testthat/some/dir`) (#811).
* the user is not prompted anymore to confirm the creation of a permanent cache
as R.cache >= 0.15.0 uses a standard location in line with CRAN policies
(#819).
* R code chunks in nested non-R chunks in R markdown don't yield an error
anymore when document is styled, chunks are still not styled (#788, #794).
* `cache_activate()` and `cache_deactivate()` now respect the R
Expand Down
24 changes: 3 additions & 21 deletions R/ui-caching.R
Original file line number Diff line number Diff line change
Expand Up @@ -32,27 +32,10 @@ cache_clear <- function(cache_name = NULL, ask = TRUE) {
#' Since we leverage `{R.cache}` to manage the cache, you can also use any
#' `{R.cache}` functionality to manipulate it.
#'
#' @section Interactive setup:
#' `{styler}` by default uses caching via the `{R.cache}` package. When interacting
#' with `{styler}`, you will be asked to let it create a permanent cache on your
#' file system that styler will use in case it is not set already up for another
#' tool that uses `{R.cache}`. We encourage users to let `{R.cache}` create a
#' permanent directory for caching because, otherwise, the cache is lost at
#' restart of R.
#'
#' @section Non-interactive setup:
#' In some cases, you want to avoid the interactive prompt described above. In
#' In some cases, you want to use a non-standard cache location. In
#' that situation, you can set the path to the cache with the R option
#' `R.cache.rootPath` or the environment variable `R_CACHE_ROOTPATH` to an
#' existent path before you call the styler API. This should avoid the prompt.
#' `R.cache::setCacheRootPath("/path/to/cache")` is also programmatic but will
#' probably give the prompt anyways if called interactively.
#'
#' @section Non-interactive use:
#' Note that if you have never authorized `{R.cache}` to create the cache in a
#' permanent directory and you use `{styler}` non-interactively, it will build the
#' cache in a temporary directory. To create a permanent cache, follow the
#' section 'Non-interactive setup' or 'Interactive setup' above.
#' existent path before you call the styler API.
#'
#' @section Invalidation:
#' The cache is specific to a version of styler by default, because different
Expand All @@ -67,8 +50,7 @@ cache_clear <- function(cache_name = NULL, ask = TRUE) {
#' @section Using a cache for styler in CI/CD:
#' If you want to set up caching in a CI/CD pipeline, we suggest to set the
#' `{R.cache}` root path to a directory for which you have the cache enabled as
#' described above in the section 'Non-interactive setup'. This can often be set
#' in config files of CI/CD tools, e.g. see the
#' This can often be set in config files of CI/CD tools, e.g. see the
#' [Travis documentation on caching](https://docs.travis-ci.com/user/caching).
#'
#' @name caching
Expand Down
30 changes: 3 additions & 27 deletions man/caching.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.