diff --git a/DESCRIPTION b/DESCRIPTION index f2138e0ee..220de80ee 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -37,7 +37,6 @@ Imports: xmlparsedata (>= 1.0.5) Suggests: bookdown, - httr (>= 1.2.1), jsonlite, patrick (>= 0.2.0), rlang, diff --git a/R/cache.R b/R/cache.R index 1db84212e..2bc3ae4d0 100644 --- a/R/cache.R +++ b/R/cache.R @@ -53,11 +53,10 @@ load_cache <- function(file, path = NULL) { invokeRestart("muffleWarning") }, error = function(e) { - warning( - "Could not load cache file '", file, "':\n", - conditionMessage(e), - call. = FALSE - ) + cli_warn(c( + x = "Could not load cache file {.file {file}}:\n", + i = conditionMessage(e) + )) } ) } # else nothing to do for source file that has no cache diff --git a/R/with.R b/R/with.R index 8a036c1b4..c132d4c46 100644 --- a/R/with.R +++ b/R/with.R @@ -181,11 +181,11 @@ all_linters <- function(..., packages = "lintr") { linters_with_defaults <- function(..., defaults = default_linters) { dots <- list(...) if (missing(defaults) && "default" %in% names(dots)) { - warning( - "'default' is not an argument to linters_with_defaults(). Did you mean 'defaults'? ", - "This warning will be removed when with_defaults() is fully deprecated.", - call. = FALSE - ) + cli_warn(c( + x = "{.arg default} is not an argument to {.fun linters_with_defaults}.", + i = "Did you mean {.arg defaults}?", + i = "This warning will be removed when {.fun with_defaults} is fully deprecated." + )) defaults <- dots$default nms <- names2(dots) missing_index <- !nzchar(nms, keepNA = TRUE) diff --git a/tests/testthat/test-with.R b/tests/testthat/test-with.R index 0e9a7f7e6..02f10cf28 100644 --- a/tests/testthat/test-with.R +++ b/tests/testthat/test-with.R @@ -94,7 +94,7 @@ test_that("linters_with_defaults(default = .) is supported with a deprecation wa { linters <- linters_with_defaults(default = list(), whitespace_linter()) }, - "'default'" + "`default` is not an argument" ) expect_named(linters, "whitespace_linter")