Skip to content
Open
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 @@ -21,7 +21,6 @@ Imports:
rlang (>= 1.1.0)
Suggests:
covr,
crayon,
knitr,
lintr,
rmarkdown,
Expand Down
25 changes: 11 additions & 14 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,17 @@ paste_line <- function(...) {
}

# 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
red <- function(x) cli::col_red(x)
blue <- function(x) cli::col_blue(x)
green <- function(x) cli::col_green(x)
yellow <- function(x) cli::col_yellow(x)
magenta <- function(x) cli::col_magenta(x)
cyan <- function(x) cli::col_cyan(x)
blurred <- function(x) cli::style_blurred(x)
silver <- function(x) cli::col_silver(x)
bold <- function(x) cli::style_bold(x)
italic <- function(x) cli::style_italic(x)
underline <- function(x) cli::style_underline(x)
# nocov end

pkg_url_bug <- function(pkg) {
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