Skip to content

Commit 664fe55

Browse files
clean up
1 parent 902892c commit 664fe55

File tree

5 files changed

+7
-15
lines changed

5 files changed

+7
-15
lines changed

R/testing.R

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -339,8 +339,5 @@ fresh_testthat_cache <- function() {
339339
}
340340

341341
cache_more_specs_default <- function() {
342-
cache_more_specs(
343-
include_roxygen_examples = TRUE,
344-
base_indention = 0
345-
)
342+
cache_more_specs(include_roxygen_examples = TRUE, base_indention = 0)
346343
}

R/transform-files.R

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -240,10 +240,7 @@ parse_transform_serialize_r <- function(text,
240240
}
241241
text_out <- convert_newlines_to_linebreaks(text_out)
242242
if (cache_is_activated()) {
243-
cache_by_expression(
244-
text_out, transformers,
245-
more_specs = more_specs
246-
)
243+
cache_by_expression(text_out, transformers, more_specs = more_specs)
247244
}
248245
text_out
249246
}

R/utils-cache.R

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ is_cached <- function(text,
2525
transformers,
2626
more_specs,
2727
cache_dir = cache_dir_default()) {
28-
2928
R.cache::generateCache(
3029
key = cache_make_key(text, transformers, more_specs),
3130
dirs = cache_dir
@@ -166,8 +165,6 @@ cache_by_expression <- function(text,
166165
#' @inheritParams cache_make_key
167166
#' @keywords internal
168167
cache_write <- function(text, transformers, more_specs) {
169-
# print(c("writing cahce for text: ", substr(paste0(text, collapse = "\n"), 1, 15)))
170-
# print(c("more_specs: ", more_specs))
171168
R.cache::generateCache(
172169
key = cache_make_key(text, transformers, more_specs),
173170
dirs = cache_dir_default()

tests/testthat/test-cache-low-level-api.R

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,11 @@ test_that("blank lines are correctly identified", {
7373
)
7474
# when not cached, all code in same block
7575
more_specs <- cache_more_specs_default()
76-
pd_nested <- compute_parse_data_nested(text, tidyverse_style(), more_specs = more_specs)
77-
cache_by_expression(
78-
text, tidyverse_style(), more_specs = more_specs
76+
pd_nested <- compute_parse_data_nested(text,
77+
transformers = tidyverse_style(),
78+
more_specs = more_specs
7979
)
80+
cache_by_expression(text, tidyverse_style(), more_specs = more_specs)
8081
expect_equal(
8182
pd_nested$block, rep(1, 4)
8283
)

tests/testthat/test-interaction-caching-stylerignore.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ test_that("does not cache stylerignore sequences", {
154154
is_cached(
155155
"1+1",
156156
tidyverse_style(),
157-
more_specs = cache_more_specs(include_roxygen_examples = FALSE, base_indention = 0)
157+
more_specs = cache_more_specs_default()
158158
)
159159
)
160160
})

0 commit comments

Comments
 (0)