Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ Imports:
rlang (>= 1.1.0)
Suggests:
covr,
crayon,
knitr,
lintr (>= 3.1.0),
rmarkdown,
Expand Down
4 changes: 3 additions & 1 deletion R/deprecate.R
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,9 @@ deprecate_warn0 <- function(
if (is_interactive()) {
footer <- c(
footer,
if (!always) silver("This warning is displayed once per session."),
if (!always) {
cli::col_silver("This warning is displayed once per session.")
},
cli::format_inline(cli::col_silver(
"Call {.run lifecycle::last_lifecycle_warnings()} to see where this warning was generated."
))
Expand Down
17 changes: 0 additions & 17 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,6 @@ paste_line <- function(...) {
paste(chr(...), collapse = "\n")
}

# nocov start
has_crayon <- function() {
is_installed("crayon") && crayon::has_color()
}
red <- function(x) if (has_crayon()) crayon::red(x) else x
blue <- function(x) if (has_crayon()) crayon::blue(x) else x
green <- function(x) if (has_crayon()) crayon::green(x) else x
yellow <- function(x) if (has_crayon()) crayon::yellow(x) else x
magenta <- function(x) if (has_crayon()) crayon::magenta(x) else x
cyan <- function(x) if (has_crayon()) crayon::cyan(x) else x
blurred <- function(x) if (has_crayon()) crayon::blurred(x) else x
silver <- function(x) if (has_crayon()) crayon::silver(x) else x
bold <- function(x) if (has_crayon()) crayon::bold(x) else x
italic <- function(x) if (has_crayon()) crayon::italic(x) else x
underline <- function(x) if (has_crayon()) crayon::underline(x) else x
# nocov end

pkg_url_bug <- function(pkg) {
# First check that package is installed, e.g. in case of
# runtime-only namespace created by pkgload
Expand Down
3 changes: 1 addition & 2 deletions tests/testthat/test-warning.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ test_that("deprecation warning is displayed with backtrace", {

local_options(
rlang_trace_top_env = current_env(),
rlang_trace_format_srcrefs = FALSE,
crayon.enabled = FALSE
rlang_trace_format_srcrefs = FALSE
)

f <- function() g()
Expand Down