Skip to content

Commit 7f95807

Browse files
committed
Merged origin/main into deprecate-release
2 parents f836c93 + 1b62d18 commit 7f95807

14 files changed

Lines changed: 100 additions & 71 deletions

DESCRIPTION

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ VignetteBuilder:
6565
knitr
6666
Config/Needs/website: tidyverse/tidytemplate
6767
Config/testthat/edition: 3
68+
Config/testthat/parallel: true
6869
Encoding: UTF-8
6970
Language: en-US
7071
Roxygen: list(markdown = TRUE)

NEWS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
# devtools (development version)
22

33
* `build_manual()` reports more details on failure (#2586).
4+
* `build_site()` now just calls `pkgdown::build_site()`, meaning that you will get more (informative) output by default (#2578).
45
* New `check_mac_devel()` function to check a package using the macOS builder at https://mac.r-project.org/macbuilder/submit.html (@nfrerebeau, #2507)
6+
* `dev_sitrep()` now works correctly in Positron (#2618).
57
* `is_loading()` is now re-exported from pkgload (#2556).
68
* `load_all()` now errors if called recursively, i.e. if you accidentally include a `load_all()` call in one of your R source files (#2617).
79
* `release()` is deprecated in favour of `usethis::use_release_issue()`.

R/build-site.R

Lines changed: 7 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,14 @@
1-
#' Execute \pkg{pkgdown} build_site in a package
1+
#' Run `pkgdown::build_site()`
22
#'
3-
#' `build_site()` is a shortcut for [pkgdown::build_site()], it generates the
4-
#' static HTML documentation.
3+
#' This is a thin wrapper around [pkgdown::build_site()], used for generating
4+
#' static HTML documentation. Learn more at <https://pkgdown.r-lib.org>.
55
#'
6-
#' @param path path to the package to build the static HTML.
7-
#' @param ... additional arguments passed to [pkgdown::build_site()]
8-
#' @inheritParams install
9-
#'
10-
#' @return NULL
6+
#' @param path Path to the package to build the static HTML.
7+
#' @param ... Additional arguments passed to [pkgdown::build_site()].
118
#' @export
12-
build_site <- function(path = ".", quiet = TRUE, ...) {
9+
build_site <- function(path = ".", ...) {
1310
rlang::check_installed("pkgdown")
1411

1512
save_all()
16-
17-
pkg <- as.package(path)
18-
19-
check_dots_used(action = getOption("devtools.ellipsis_action", rlang::warn))
20-
21-
withr::with_temp_libpaths(action = "prefix", code = {
22-
install(pkg = pkg$path, upgrade = "never", reload = FALSE, quiet = quiet)
23-
if (isTRUE(quiet)) {
24-
withr::with_output_sink(
25-
file_temp(),
26-
pkgdown::build_site(pkg = pkg$path, ...)
27-
)
28-
} else {
29-
pkgdown::build_site(pkg = pkg$path, ...)
30-
}
31-
})
13+
pkgdown::build_site(pkg = path, ...)
3214
}

R/check-win.R

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,7 @@ check_win <- function(
118118
))
119119

120120
email <- maintainer(pkg)$email
121-
if (interactive() && yesno("Email results to {.strong {email}}?")) {
122-
return(invisible())
123-
}
121+
confirm_maintainer_email(email)
124122
}
125123

126124
built_path <- pkgbuild::build(
@@ -154,6 +152,24 @@ check_win <- function(
154152
invisible()
155153
}
156154

155+
confirm_maintainer_email <- function(email, call = parent.frame()) {
156+
if (!rlang::is_interactive()) {
157+
return(FALSE)
158+
}
159+
160+
if (!yesno("Email results to {.strong {email}}?")) {
161+
return()
162+
}
163+
164+
cli::cli_abort(
165+
c(
166+
"User declined upload.",
167+
i = "Use `email = {.str your email}` to override."
168+
),
169+
call = call
170+
)
171+
}
172+
157173
change_maintainer_email <- function(path, email, call = parent.frame()) {
158174
desc <- desc::desc(file = path)
159175

R/sitrep.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ dev_sitrep <- function(pkg = ".", debug = FALSE) {
118118
remotes::dev_package_deps(pkg$path, dependencies = TRUE)
119119
},
120120
rstudio_version = if (is_rstudio_running()) rstudioapi::getVersion(),
121-
rstudio_msg = check_for_rstudio_updates()
121+
rstudio_msg = if (!is_positron()) check_for_rstudio_updates()
122122
),
123123
class = "dev_sitrep"
124124
)
@@ -156,7 +156,7 @@ print.dev_sitrep <- function(x, ...) {
156156
}
157157

158158
if (!is.null(x$rstudio_version)) {
159-
hd_line("RStudio")
159+
hd_line(if (is_positron()) "Positron" else "RStudio")
160160
kv_line("version", x$rstudio_version)
161161

162162
if (!is.null(x$rstudio_msg)) {

R/utils.R

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ is_testing <- function() {
4141
identical(Sys.getenv("TESTTHAT"), "true")
4242
}
4343

44+
is_positron <- function() {
45+
Sys.getenv("POSITRON") == "1"
46+
}
47+
4448
is_rstudio_running <- function() {
4549
!is_testing() && rstudioapi::isAvailable()
4650
}

man/build_site.Rd

Lines changed: 6 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Package pkgdown site can be built
2+
3+
Code
4+
build_site(path = "testPkgdown", override = list(destination = destination))
5+
Message
6+
-- Installing package testPkgdown into temporary library -----------------------
7+
-- Finished building pkgdown site for package testPkgdown ----------------------
8+

tests/testthat/_snaps/check-doc.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# check_man works
2+
3+
Code
4+
check_man(pkg)
5+
Message
6+
i Updating {package} documentation
7+
i Loading {package}
8+
i Checking documentation...
9+
Output
10+
Rd files without \alias:
11+
'foo.Rd'
12+
Rd files without \description:
13+
'foo.Rd'
14+
Argument items with no description in Rd file 'foo.Rd':
15+
'foo'
16+
Undocumented arguments in Rd file 'foo.Rd'
17+
'x'
18+
19+

tests/testthat/_snaps/check-win.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,14 @@
1414
Error:
1515
! DESCRIPTION can't use Maintainer field when changing `email`
1616

17+
# email confirmation gives useful advice
18+
19+
Code
20+
confirm_maintainer_email("hadley@posit.co")
21+
Message
22+
Email results to hadley@posit.co?
23+
Condition
24+
Error:
25+
! User declined upload.
26+
i Use `email = "your email"` to override.
27+

0 commit comments

Comments
 (0)