Skip to content

Commit 8f839e6

Browse files
Merge pull request #1124 from r-lib/rc-1.10.1
Release {styler} v1.10.1
2 parents d71e2cc + b1d4793 commit 8f839e6

15 files changed

+70
-28
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ default_language_version:
66

77
repos:
88
- repo: https://github.com/lorenzwalthert/precommit
9-
rev: v0.3.2.9007
9+
rev: f3498c421d68a1db26de1a1fe3ecc91dd6f03b5e
1010
hooks:
1111
- id: style-files
1212
args:

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Type: Package
22
Package: styler
33
Title: Non-Invasive Pretty Printing of R Code
4-
Version: 1.10.0.9000
4+
Version: 1.10.1
55
Authors@R:
66
c(person(given = "Kirill",
77
family = "Müller",

NEWS.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
1-
<!-- NEWS.md is maintained by https://cynkra.github.io/fledge, do not edit -->
1+
# styler 1.10.1
2+
3+
This release was requested by CRAN due to accidentally populating a user cache while building vignettes for R >= 4.3.0.
4+
5+
* Code quality improvements (#1122).
6+
* Bump JamesIves/github-pages-deploy-action from 4.4.1 to 4.4.2 (#1123).
7+
8+
Thanks to everyone who contributed to this release: [&#x0040;olivroy](https://github.com/olivroy) and [&#x0040;krlmlr](https://github.com/krlmlr).
9+
210
# styler 1.10.0
311

412
This release contains speed-ups between 20% and 40% depending on your use case

R/zzz.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ remove_old_cache_files <- function() {
7676
path_version_specific,
7777
full.names = TRUE, recursive = TRUE
7878
)
79-
date_boundary <- Sys.time() - 60L * 60L * 24L * 6L
79+
date_boundary <- Sys.time() - as.difftime(6L, units = "days")
8080
file.remove(
8181
all_cached[file.info(all_cached)$mtime < date_boundary]
8282
)

cran-comments.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ editor_options:
44
wrap: 79
55
---
66

7-
This is a release requested by the CRAN team to delete empty directories in the
8-
user's cache.
7+
This is a release requested by the CRAN team to delete the population of the
8+
user's cache while building vignettes.
99

1010

1111
## Test environments

inst/WORDLIST

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ iNZightTools
107107
io
108108
ixmypi
109109
ized
110+
JamesIves
110111
Jupyterlab
111112
Kirill
112113
kirill

tests/testthat/test-cache-clean-up.R

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
test_that("styler tests did not use R.cache in user root", {
2+
skip_on_cran()
3+
skip_on_covr()
4+
skip_during_parallel()
5+
expect_true(
6+
length(list.files(R.cache::getCachePath("styler"), recursive = TRUE)) == 0L
7+
)
8+
})
9+
10+
test_that("clear Cache", {
11+
# if R CMD CHECK is detected, R.cache root is set to a temp
12+
# directory by default.
13+
# https://github.com/HenrikBengtsson/R.cache/commit/c7ac171f15f035674346d5504049c38cf07c268f
14+
# Hence, this clean up won't clean up the user directory.
15+
skip_during_parallel()
16+
cache_path <- R.cache::getCachePath("styler")
17+
R.cache::clearCache(cache_path, recursive = TRUE, prompt = FALSE)
18+
skip_on_cran()
19+
skip_on_covr()
20+
expect_true(
21+
length(list.dirs(R.cache::getCachePath("styler"))) == 1L
22+
)
23+
})

tests/testthat/test-zzz.R

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,3 @@
1-
test_that("styler tests did not use R.cache in user root", {
2-
skip_on_cran()
3-
skip_on_covr()
4-
expect_true(
5-
length(list.files(R.cache::getCachePath("styler"), recursive = TRUE)) == 0L
6-
)
7-
})
8-
9-
test_that("clear Cache", {
10-
R.cache::clearCache(R.cache::getCachePath("styler"), recursive = TRUE)
11-
skip_on_cran()
12-
skip_on_covr()
13-
expect_true(
14-
length(list.dirs(R.cache::getCachePath("styler"))) == 1L
15-
)
16-
})
17-
18-
191
test_that("can delete empty cache directory", {
202
skip_if(getRversion() < package_version("4.0.0"))
213
skip_on_cran()

vignettes/caching.Rmd

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ knitr::opts_chunk$set(
1212
collapse = TRUE,
1313
comment = "#>"
1414
)
15+
options(styler.colored_print.vertical = FALSE)
16+
styler::cache_deactivate()
1517
```
1618

1719
```{r setup}

vignettes/customizing_styler.Rmd

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,15 @@ vignette: >
77
%\VignetteEncoding{UTF-8}
88
---
99

10+
```{r}
11+
knitr::opts_chunk$set(
12+
collapse = TRUE,
13+
comment = "#>"
14+
)
15+
options(styler.colored_print.vertical = FALSE)
16+
styler::cache_deactivate()
17+
```
18+
1019
This vignette provides a high-level overview of how styler works and how you can define your own style guide and format code according to it. If you simply want to customize the tidyverse style guide to your needs, check out `vignette("styler")`, to remove some rules, have a look at `vignette("remove_rules")`. How to distribute a custom style guide is described in `vignette("distribute_custom_style_guides")`.
1120

1221
# How styler works

0 commit comments

Comments
 (0)