Skip to content

Commit d1d618b

Browse files
committed
Merge branch 'main' into check-doc-fields
2 parents 31033d6 + 694e6c6 commit d1d618b

74 files changed

Lines changed: 661 additions & 710 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

DESCRIPTION

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,8 @@ Imports:
3535
roxygen2 (>= 7.3.3),
3636
rversions (>= 2.1.2),
3737
sessioninfo (>= 1.2.3),
38-
stats,
3938
testthat (>= 3.2.3),
40-
tools,
4139
urlchecker (>= 1.0.1),
42-
utils,
4340
withr (>= 3.0.2)
4441
Suggests:
4542
BiocManager (>= 1.30.18),
@@ -50,21 +47,17 @@ Suggests:
5047
DT (>= 0.23),
5148
foghorn (>= 1.4.2),
5249
gh (>= 1.3.0),
53-
gmailr (>= 1.0.1),
5450
httr (>= 1.4.3),
5551
knitr (>= 1.39),
5652
lintr (>= 3.0.0),
57-
MASS,
58-
mockery (>= 0.4.3),
59-
pingr (>= 2.0.1),
60-
rhub (>= 1.1.1),
6153
rmarkdown (>= 2.14),
6254
rstudioapi (>= 0.13),
6355
spelling (>= 2.2)
6456
VignetteBuilder:
6557
knitr
6658
Config/Needs/website: tidyverse/tidytemplate
6759
Config/testthat/edition: 3
60+
Config/testthat/parallel: true
6861
Encoding: UTF-8
6962
Language: en-US
7063
Roxygen: list(markdown = TRUE)

NAMESPACE

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,6 @@ export(uses_testthat)
8383
export(wd)
8484
export(with_debug)
8585
import(fs)
86-
importFrom(cli,cat_bullet)
87-
importFrom(cli,cat_rule)
8886
importFrom(ellipsis,check_dots_used)
8987
importFrom(lifecycle,deprecated)
9088
importFrom(memoise,memoise)
@@ -96,21 +94,6 @@ importFrom(pkgload,check_dep_version)
9694
importFrom(pkgload,is_loading)
9795
importFrom(pkgload,parse_deps)
9896
importFrom(pkgload,unload)
99-
importFrom(remotes,dev_package_deps)
100-
importFrom(remotes,github_pull)
101-
importFrom(remotes,github_release)
102-
importFrom(remotes,install_bioc)
103-
importFrom(remotes,install_bitbucket)
104-
importFrom(remotes,install_cran)
105-
importFrom(remotes,install_dev)
106-
importFrom(remotes,install_git)
107-
importFrom(remotes,install_github)
108-
importFrom(remotes,install_gitlab)
109-
importFrom(remotes,install_local)
110-
importFrom(remotes,install_svn)
111-
importFrom(remotes,install_url)
112-
importFrom(remotes,install_version)
113-
importFrom(remotes,update_packages)
11497
importFrom(sessioninfo,package_info)
11598
importFrom(sessioninfo,session_info)
11699
importFrom(stats,update)
@@ -121,11 +104,3 @@ importFrom(usethis,ui_path)
121104
importFrom(usethis,ui_todo)
122105
importFrom(usethis,ui_value)
123106
importFrom(usethis,use_test)
124-
importFrom(utils,available.packages)
125-
importFrom(utils,contrib.url)
126-
importFrom(utils,install.packages)
127-
importFrom(utils,installed.packages)
128-
importFrom(utils,modifyList)
129-
importFrom(utils,packageDescription)
130-
importFrom(utils,packageVersion)
131-
importFrom(utils,remove.packages)

NEWS.md

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

3+
* `bash()`, `create()`, `missing_s3()`, `reload()`, `show_news()`, and `wd()` are now deprecated. These functions are all historical parts of our workflow that we no longer use or recommend. `create()` is superseded by `usethis::create_package()`.
34
* `build_manual()` reports more details on failure (#2586).
45
* New `check_doc_fields()` checks for missing `\value` and `\examples` fields in Rd files, which are commonly flagged by CRAN (#2525).
6+
* `build_vignettes()` and `clean_vignettes()` are now deprecated. We no longer recommend building vignettes in this way; instead use `pkgdown::build_article()` to render articles locally (#2488).
7+
* `build_site()` now just calls `pkgdown::build_site()`, meaning that you will get more (informative) output by default (#2578).
58
* New `check_mac_devel()` function to check a package using the macOS builder at https://mac.r-project.org/macbuilder/submit.html (@nfrerebeau, #2507)
9+
* `dev_sitrep()` now works correctly in Positron (#2618).
610
* `is_loading()` is now re-exported from pkgload (#2556).
11+
* Package installation functions are now deprecated: `install_bioc()`, `install_bitbucket()`, `install_cran()`, `install_deps()`, `install_dev()`, `install_dev_deps()`, `install_git()`, `install_github()`, `install_gitlab()`, `install_local()`, `install_svn()`, `install_url()`, `install_version()`, `update_packages()`, `dev_package_deps()`, `github_pull()`, and `github_release()`. We now recommend pak (<https://pak.r-lib.org/>) for general package installation. See `?install-deprecated` for migration guidance.
712
* `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).
13+
* `release()` is deprecated in favour of `usethis::use_release_issue()`.
814
* `show_news()` now looks for NEWS files in the same locations as `utils::news()`: `inst/NEWS.Rd`, `NEWS.md`, `NEWS`, and `inst/NEWS` (@arcresu, #2499).
15+
* `test_file()` and `test_coverage_file()` are now defunct. These were deprecated in devtools 2.4.0 (2021-04-07) in favour of `test_active_file()` and `test_coverage_active_file()`. Removing `test_file()` eliminates the conflict with `testthat::test_file()`.
916

1017
# devtools 2.4.6
1118

R/bash.R

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
1-
#' Open bash shell in package directory.
1+
#' Open bash shell in package directory
2+
#'
3+
#' @description
4+
#' `r lifecycle::badge("deprecated")`
5+
#'
6+
#' `bash()` is deprecated because we no longer use or recommend this workflow.
7+
#' Open bash shell in package directory
28
#'
39
#' @template devtools
410
#' @export
11+
#' @keywords internal
512
bash <- function(pkg = ".") {
13+
lifecycle::deprecate_warn("2.5.0", "bash()")
614
pkg <- as.package(pkg)
715

816
withr::with_dir(pkg$path, system("bash"))

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-devtools.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#' Custom devtools release checks.
1+
#' Custom devtools release checks
22
#'
33
#' This function performs additional checks prior to release. It is called
44
#' automatically by [release()].
@@ -8,15 +8,15 @@
88
#' @export
99
release_checks <- function(pkg = ".", built_path = NULL) {
1010
pkg <- as.package(pkg)
11-
cat_rule(paste0("Running additional devtools checks for ", pkg$package))
11+
cli::cat_rule(paste0("Running additional devtools checks for ", pkg$package))
1212

1313
check_version(pkg)
1414
check_dev_versions(pkg)
1515
check_vignette_titles(pkg)
1616
check_news_md(pkg)
1717
check_remotes(pkg)
1818

19-
cat_rule()
19+
cli::cat_rule()
2020
}
2121

2222
check_dev_versions <- function(pkg = ".") {

R/check-doc.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#' Check documentation, as `R CMD check` does.
1+
#' Check documentation, as `R CMD check` does
22
#'
33
#' This function attempts to run the documentation related checks in the
44
#' same way that `R CMD check` does. Unfortunately it can't run them

R/check-git.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#' Git checks.
1+
#' Git checks
22
#'
33
#' This function performs Git checks checks prior to release. It is called
44
#' automatically by [release()].
@@ -7,11 +7,11 @@
77
#' @keywords internal
88
git_checks <- function(pkg = ".") {
99
pkg <- as.package(pkg)
10-
cat_rule(paste0("Running Git checks for ", pkg$package))
10+
cli::cat_rule(paste0("Running Git checks for ", pkg$package))
1111

1212
git_report_branch(pkg)
1313
git_check_uncommitted(pkg)
14-
cat_rule()
14+
cli::cat_rule()
1515
}
1616

1717
git_report_branch <- function(pkg) {

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/check.R

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ check <- function(
8585
document <- document %||% can_document(pkg$roxygennote)
8686
if (document) {
8787
if (!quiet) {
88-
cat_rule("Documenting", col = "cyan", line = 2)
88+
cli::cat_rule("Documenting", col = "cyan", line = 2)
8989
}
9090
document(pkg, quiet = quiet)
9191
if (!quiet) {
@@ -94,7 +94,7 @@ check <- function(
9494
}
9595

9696
if (!quiet) {
97-
cat_rule("Building", col = "cyan", line = 2)
97+
cli::cat_rule("Building", col = "cyan", line = 2)
9898
show_env_vars(pkgbuild::compiler_flags(FALSE))
9999
}
100100

@@ -133,7 +133,7 @@ check <- function(
133133
)
134134
}
135135

136-
can_document <- function(required, installed = packageVersion("roxygen2")) {
136+
can_document <- function(required, installed = utils::packageVersion("roxygen2")) {
137137
if (is.null(required)) {
138138
return(FALSE)
139139
}
@@ -222,7 +222,7 @@ check_built <- function(
222222

223223
env_vars <- check_env_vars(cran, remote, incoming, force_suggests, env_vars)
224224
if (!quiet) {
225-
cat_rule("Checking", col = "cyan", line = 2)
225+
cli::cat_rule("Checking", col = "cyan", line = 2)
226226
show_env_vars(env_vars)
227227
}
228228

@@ -271,7 +271,7 @@ aspell_env_var <- function() {
271271

272272
show_env_vars <- function(env_vars) {
273273
cli::cat_line("Setting env vars:", col = "darkgrey")
274-
cat_bullet(
274+
cli::cat_bullet(
275275
paste0(format(names(env_vars)), ": ", unname(env_vars)),
276276
col = "darkgrey"
277277
)

0 commit comments

Comments
 (0)