Skip to content

Commit a8b1f61

Browse files
more edits
1 parent dbd5dda commit a8b1f61

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

R/ui-caching.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#' `NULL`, the option "styler.cache_name" is considered which defaults to
99
#' the version of styler used.
1010
#' @details
11-
#' Each version of styler has it's own cache by default, because styling is
11+
#' Each version of styler has its own cache by default, because styling is
1212
#' potentially different with different versions of styler.
1313
#' @param ask Whether or not to interactively ask the user again.
1414
#' @family cache managers
@@ -61,7 +61,7 @@ NULL
6161
#'
6262
#' Gives information about the cache. Note that the size consumed by the cache
6363
#' will always be displayed as zero because all the cache does is creating an
64-
#' empty file of size 0 bytes for every cached expression. The innode is
64+
#' empty file of size 0 bytes for every cached expression. The inode is
6565
#' excluded from this displayed size but negligible.
6666
#' @param cache_name The name of the cache for which to show details. If
6767
#' `NULL`, the active cache is used. If none is active the cache corresponding

R/ui-styling.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#' @api
1+
#' @keywords api
22
#' @import tibble
33
#' @importFrom magrittr %>%
44
NULL

man/cache_clear.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/cache_info.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vignettes/caching.Rmd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ knitr::opts_chunk$set(
1818
library(styler)
1919
```
2020

21-
This is a developer vignette to explain how caching works and what we learned on the way. To use the caching feature, please have a look at the README.
21+
This is a developer vignette to explain how caching works and what we learned on the way.
2222

2323
The main caching features were implemented in the following two pull requests:
2424

25-
- #538: Implemented simple caching and utilities for managing caches. Input text is styled as a whole and added to the cache afterwards. This makes most sense given that the very same expression will probably never be passed to styler, unless it is already compliant with the style guide. Apart from the (negligible) innode, caching text has a memory cost of 0. Speed boosts only result if the whole text passed to styler is compliant to the style guide in use. Changing one line in a file with hundreds of lines means each line will be styled again. This is a major drawback and makes the cache only useful for a use with a pre-commit framework (the initial motivation) or when functions like `style_pkg()` are run often and most files were not changed.
25+
- #538: Implemented simple caching and utilities for managing caches. Input text is styled as a whole and added to the cache afterwards. This makes most sense given that the very same expression will probably never be passed to styler, unless it is already compliant with the style guide. Apart from the (negligible) inode, caching text has a memory cost of 0. Speed boosts only result if the whole text passed to styler is compliant to the style guide in use. Changing one line in a file with hundreds of lines means each line will be styled again. This is a major drawback and makes the cache only useful for a use with a pre-commit framework (the initial motivation) or when functions like `style_pkg()` are run often and most files were not changed.
2626

2727
- #578: Adds a second layer of caching by caching top-level expressions individually. This will bring speed boosts to the situation where very little is changed but there are many top-level expressions. Hence, changing one line in a big file will invalidate the cache for the expression the line is part of, i.e. when changing `x <- 2` to `x = 2` below, styler will have to restyle the function definition, but not `another(call)` and all other expressions that were not changed.
2828

0 commit comments

Comments
 (0)