Skip to content

Commit f20f942

Browse files
committed
Replace DEV = TRUE with snapshot.dev
1 parent 46caad4 commit f20f942

File tree

10 files changed

+43
-21
lines changed

10 files changed

+43
-21
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Imports:
3434
quarto,
3535
rcmdcheck,
3636
remotes,
37-
renv (>= 1.0.3),
37+
renv (>= 1.1.6),
3838
rlang,
3939
rmarkdown,
4040
rstudioapi,

NEWS.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# rdev 1.16.0
2+
3+
* Updated `check_renv()` and `ci()`, replacing `renv::status(dev = TRUE)` with new renv 1.1.6 setting `renv::settings$snapshot.dev(TRUE)`
4+
15
# rdev 1.15.6
26

37
* Added instructions for YAML chunk syntax update to `upkeep_checklist()`

R/ci.R

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#' Check renv
22
#'
3-
#' Runs [`renv`][renv::renv-package] [`status(dev = TRUE)`][renv::status()],
4-
#' [`clean()`][renv::clean()], and optionally [`update()`][renv::update()]
3+
#' Runs [`renv`][renv::renv-package] [`status()`][renv::status()], [`clean()`][renv::clean()]
4+
#' and optionally [`update()`][renv::update()]
55
#'
66
#' @param update run [renv::update()]
77
#'
@@ -14,8 +14,8 @@
1414
check_renv <- function(update = rlang::is_interactive()) {
1515
checkmate::assert_flag(update)
1616

17-
writeLines("renv::status(dev = TRUE)")
18-
renv::status(dev = TRUE)
17+
writeLines("renv::status()")
18+
renv::status()
1919

2020
writeLines("\nrenv::clean()")
2121
renv::clean()
@@ -84,7 +84,7 @@ print_tbl <- function(df) {
8484
#'
8585
#' Run continuous integration tests locally.
8686
#'
87-
#' If [`renv::status(dev = TRUE)`][renv::status()] is not synchronized, `ci()` will stop.
87+
#' If [`renv::status()`][renv::status()] is not synchronized, `ci()` will stop.
8888
#'
8989
#' If [missing_deps()] returns any missing dependencies, `ci()` will stop.
9090
#'
@@ -98,7 +98,7 @@ print_tbl <- function(df) {
9898
#' Output from `missing`, `extra`, and `urls` is printed as a [tibble][tibble::tibble()] for
9999
#' improved readability in the console.
100100
#'
101-
#' @param renv check [`renv::status(dev = TRUE)`][renv::status()]
101+
#' @param renv check [`renv::status()`][renv::status()]
102102
#' @param missing run [missing_deps()]
103103
#' @param pkgdown check [pkgdown::check_pkgdown()] if `_pkgdown.yml` exists
104104
#' @param styler style all files using [style_all()], see details
@@ -142,8 +142,8 @@ ci <- function(renv = TRUE, # nolint: cyclocomp_linter.
142142
checkmate::assert_flag(rcmdcheck)
143143

144144
if (renv) {
145-
writeLines("renv::status(dev = TRUE)")
146-
status <- renv::status(dev = TRUE)
145+
writeLines("renv::status()")
146+
status <- renv::status()
147147
if (!status$synchronized) {
148148
return(invisible(status))
149149
}

R/setup.R

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ use_spelling <- function(lang = "en-US", prompt = FALSE) {
110110
usethis::use_package("fs", type = "Suggests")
111111
usethis::use_package("withr", type = "Suggests")
112112
desc::desc_normalize()
113-
renv::snapshot(dev = TRUE, prompt = prompt)
113+
renv::snapshot(prompt = prompt)
114114
}
115115

116116
#' Use rdev code coverage
@@ -145,7 +145,7 @@ use_codecov <- function(prompt = FALSE) {
145145
usethis::use_package("covr", type = "Suggests")
146146
renv::install("DT")
147147
usethis::use_package("DT", type = "Suggests")
148-
renv::snapshot(dev = TRUE, prompt = prompt)
148+
renv::snapshot(prompt = prompt)
149149
}
150150

151151
#' Get license option
@@ -514,7 +514,10 @@ use_rdev_package <- function(quiet = TRUE) {
514514

515515
# run renv::init() last to restart the session
516516
# specify repos to use CRAN mirror instead of Posit Public Package Manager
517-
renv::init(settings = list(snapshot.type = "implicit"), repos = "https://cloud.r-project.org")
517+
renv::init(
518+
settings = list(snapshot.type = "implicit", snapshot.dev = TRUE),
519+
repos = "https://cloud.r-project.org"
520+
)
518521
}
519522

520523
#' Use Analysis Package Layout
@@ -669,7 +672,7 @@ use_analysis_package <- function(use_quarto = TRUE, prompt = FALSE) {
669672
} else {
670673
usethis::use_package("pkgdown", type = "Suggests")
671674
}
672-
renv::snapshot(dev = TRUE, prompt = prompt)
675+
renv::snapshot(prompt = prompt)
673676

674677
ret <- list(
675678
dirs = analysis_dirs, rbuildignore = analysis_rbuildignore, gitignore = analysis_gitignore

R/upkeep.R

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,15 @@ upkeep_checklist <- function(last_upkeep = last_upkeep_year()) { # nolint: cyclo
127127
""
128128
)
129129
}
130+
if (last_upkeep <= 2026 && !renv::settings$snapshot.dev()) {
131+
bullets <- c(
132+
bullets,
133+
"### 2026",
134+
"",
135+
todo("`renv::settings$snapshot.dev(TRUE)`"),
136+
""
137+
)
138+
}
130139

131140
minimum_r_version <- pkg_minimum_r_version()
132141
if (is.na(minimum_r_version) || "3.6.3" > minimum_r_version) minimum_r_version <- "3.6.3"

TODO.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@
5656
- [x] Remove `preset: bootstrap` workaround when pkgdown 2.0.8+ is released (per <https://github.com/r-lib/pkgdown/issues/2376>)
5757
- [x] Replace `GITHUB_PAT` in `.Renviron` with [gitcreds](https://usethis.r-lib.org/articles/git-credentials.html)
5858
- [x] Review use of [usethis functions](https://usethis.r-lib.org/reference/index.html), including [pull request helpers](https://usethis.r-lib.org/articles/pr-functions.html)
59+
- [X] Replace `dev = TRUE` logic after renv 1.1.6+ is released; see renv [#1695](https://github.com/rstudio/renv/issues/1695), [#2190](https://github.com/rstudio/renv/pull/2190)
5960
- [ ] Update tests with new testthat features (`testthat::auto_test_package()`, `testthat::describe()`, Reporters, `testthat::local_mocked_bindings()`)
60-
- [ ] Replace `dev = TRUE` logic after renv 1.1.6+ is released; see renv [#1695](https://github.com/rstudio/renv/issues/1695), [#2190](https://github.com/rstudio/renv/pull/2190)
6161
- [ ] Update errors and messages after reading Advanced R [Conditions](https://adv-r.hadley.nz/conditions.html) and re-reading the Tidyverse [Style Guide](https://style.tidyverse.org/index.html)
6262
- [ ] Reduce the number of Imports, per R CMD check:
6363

man/check_renv.Rd

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

man/ci.Rd

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

tests/testthat/test-ci.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ test_that("All renv functions are called, unless set to FALSE", {
1818
begin <- "^"
1919
end <- "$"
2020
sep <- "\\n\\n"
21-
status <- "renv::status\\(dev = TRUE\\)"
21+
status <- "renv::status\\(\\)"
2222
clean <- "renv::clean\\(\\)"
2323
update <- "renv::update\\(\\)"
2424

@@ -121,7 +121,7 @@ test_that("All renv functions are called according to ci logic", {
121121
begin <- "^"
122122
end <- "$"
123123
sep <- "\\n\\n"
124-
renv <- "renv::status\\(dev = TRUE\\)"
124+
renv <- "renv::status\\(\\)"
125125
missing <- "missing_deps\\(\\)"
126126
pkgdown <- "pkgdown::check_pkgdown\\(\\)"
127127
styler <- "style_all\\(\\)"

tests/testthat/test-upkeep.R

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,12 @@ test_that("use_upkeep_issue validates arguments", {
1818

1919
# upkeep_checklist
2020

21-
base_length <- 43
21+
base_length <- 47
2222

2323
test_that("upkeep_checklist is expected length for first upkeep", {
2424
usethis::ui_silence(local_temppkg(type = "rdev"))
2525
mockery::stub(upkeep_checklist, "desc::desc_has_dep", TRUE)
26+
mockery::stub(upkeep_checklist, "renv::settings$snapshot.dev", FALSE)
2627

2728
# get_license() "mit", package_type() "rdev", pkg_minimum_r_version NA, r_version character(0),
2829
# usethis::git_default_branch() "master", no inst/templates or inst/rmarkdown/templates
@@ -63,11 +64,15 @@ test_that("upkeep_checklist is expected length for first upkeep", {
6364

6465
mockery::stub(upkeep_checklist, "desc::desc_has_dep", FALSE)
6566
expect_length(upkeep_checklist(), base_length)
67+
68+
mockery::stub(upkeep_checklist, "renv::settings$snapshot.dev", FALSE)
69+
expect_length(upkeep_checklist(), base_length)
6670
})
6771

6872
test_that("upkeep_checklist is expected length for last upkeep year", {
6973
usethis::ui_silence(local_temppkg(type = "rdev"))
7074
mockery::stub(upkeep_checklist, "desc::desc_has_dep", TRUE)
75+
mockery::stub(upkeep_checklist, "renv::settings$snapshot.dev", FALSE)
7176

7277
expect_length(upkeep_checklist(), base_length)
7378
expect_length(upkeep_checklist(2021), base_length)
@@ -76,4 +81,5 @@ test_that("upkeep_checklist is expected length for last upkeep year", {
7681
expect_length(upkeep_checklist(2024), base_length - 16)
7782
expect_length(upkeep_checklist(2025), base_length - 16)
7883
expect_length(upkeep_checklist(2026), base_length - 30)
84+
expect_length(upkeep_checklist(2027), base_length - 34)
7985
})

0 commit comments

Comments
 (0)