Skip to content

Commit 13aeb67

Browse files
authored
rlang upkeep (#2655)
Import rlang, bring in the standalone checkers, and use them in a couple of places.
1 parent f023fb2 commit 13aeb67

27 files changed

+1033
-52
lines changed

.lintr.R

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,8 @@ linters <- list(lintr::undesirable_function_linter(
1616
),
1717
symbol_is_undesirable = FALSE
1818
))
19+
20+
exclusions <- list(
21+
"R/import-standalone-obj-type.R",
22+
"R/import-standalone-types-check.R"
23+
)

NAMESPACE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ export(uses_testthat)
8383
export(wd)
8484
export(with_debug)
8585
import(fs)
86+
import(rlang)
8687
importFrom(ellipsis,check_dots_used)
8788
importFrom(lifecycle,deprecated)
8889
importFrom(memoise,memoise)

R/active.R

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
find_active_file <- function(arg = "file", call = parent.frame()) {
22
if (!is_rstudio_running()) {
3-
cli::cli_abort(
4-
"Argument {.arg {arg}} is missing, with no default",
5-
call = call
6-
)
3+
cli::cli_abort("{.arg {arg}} is absent but must be supplied.", call = call)
74
}
85
normalizePath(rstudioapi::getSourceEditorContext()$path)
96
}

R/build-readme.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ build_rmd <- function(
1818
...,
1919
quiet = TRUE
2020
) {
21-
check_dots_used(action = getOption("devtools.ellipsis_action", rlang::warn))
21+
check_dots_used(action = getOption("devtools.ellipsis_action", warn))
2222

2323
pkg <- as.package(path)
2424

25-
rlang::check_installed("rmarkdown")
25+
check_installed("rmarkdown")
2626
save_all()
2727

2828
paths <- files

R/build-site.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#' @param ... Additional arguments passed to [pkgdown::build_site()].
88
#' @export
99
build_site <- function(path = ".", ...) {
10-
rlang::check_installed("pkgdown")
10+
check_installed("pkgdown")
1111

1212
save_all()
1313
pkgdown::build_site(pkg = path, ...)

R/check-mac.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ check_mac_release <- function(
1919
quiet = FALSE,
2020
...
2121
) {
22-
check_dots_used(action = getOption("devtools.ellipsis_action", rlang::warn))
22+
check_dots_used(action = getOption("devtools.ellipsis_action", warn))
2323

2424
check_mac(
2525
pkg = pkg,
@@ -42,7 +42,7 @@ check_mac_devel <- function(
4242
quiet = FALSE,
4343
...
4444
) {
45-
check_dots_used(action = getOption("devtools.ellipsis_action", rlang::warn))
45+
check_dots_used(action = getOption("devtools.ellipsis_action", warn))
4646

4747
check_mac(
4848
pkg = pkg,
@@ -100,7 +100,7 @@ check_mac <- function(
100100

101101
url <- "https://mac.r-project.org/macbuilder/v1/submit"
102102

103-
rlang::check_installed("httr")
103+
check_installed("httr")
104104
body <- list(
105105
pkgfile = httr::upload_file(built_path),
106106
rflavor = tolower(version)

R/check-win.R

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ check_win_devel <- function(
2828
quiet = FALSE,
2929
...
3030
) {
31-
check_dots_used(action = getOption("devtools.ellipsis_action", rlang::warn))
31+
check_dots_used(action = getOption("devtools.ellipsis_action", warn))
3232

3333
check_win(
3434
pkg = pkg,
@@ -51,7 +51,7 @@ check_win_release <- function(
5151
quiet = FALSE,
5252
...
5353
) {
54-
check_dots_used(action = getOption("devtools.ellipsis_action", rlang::warn))
54+
check_dots_used(action = getOption("devtools.ellipsis_action", warn))
5555

5656
check_win(
5757
pkg = pkg,
@@ -74,7 +74,7 @@ check_win_oldrelease <- function(
7474
quiet = FALSE,
7575
...
7676
) {
77-
check_dots_used(action = getOption("devtools.ellipsis_action", rlang::warn))
77+
check_dots_used(action = getOption("devtools.ellipsis_action", warn))
7878

7979
check_win(
8080
pkg = pkg,
@@ -200,7 +200,7 @@ change_maintainer_email <- function(path, email, call = parent.frame()) {
200200
}
201201

202202
upload_ftp <- function(file, url, verbose = FALSE) {
203-
rlang::check_installed("curl")
203+
check_installed("curl")
204204

205205
stopifnot(file_exists(file))
206206
stopifnot(is.character(url))

R/check.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ check <- function(
9898
show_env_vars(pkgbuild::compiler_flags(FALSE))
9999
}
100100

101-
check_dots_used(action = getOption("devtools.ellipsis_action", rlang::warn))
101+
check_dots_used(action = getOption("devtools.ellipsis_action", warn))
102102

103103
if (identical(vignettes, FALSE)) {
104104
args <- union(args, "--ignore-vignettes")

R/devtools-package.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
## usethis namespace: start
1313
#' @importFrom ellipsis check_dots_used
1414
#' @importFrom lifecycle deprecated
15+
#' @import rlang
1516
## usethis namespace: end
1617
NULL
1718

0 commit comments

Comments
 (0)