From c095f081601548c1bc22656d8b40db9f3bc4a4fa Mon Sep 17 00:00:00 2001 From: Olivier Roy Date: Wed, 17 Jan 2024 14:32:47 -0500 Subject: [PATCH] Respect usethis.quiet. --- R/ui.R | 6 +++--- tests/testthat/_snaps/tidyverse.md | 6 ------ 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/R/ui.R b/R/ui.R index 460104f12..02a912227 100644 --- a/R/ui.R +++ b/R/ui.R @@ -62,20 +62,20 @@ ui_line <- function(x = character(), .envir = parent.frame()) { #' @export ui_todo <- function(x, .envir = parent.frame()) { # No longer red - cli::cli_ul(x, .envir = .envir) + if (!is_quiet()) cli::cli_ul(x, .envir = .envir) } #' @rdname ui #' @export ui_done <- function(x, .envir = parent.frame()) { - cli::cli_alert_success(paste(x, collapse = "\n\u00a0\u00a0"), .envir = .envir) + if (!is_quiet()) cli::cli_alert_success(paste(x, collapse = "\n\u00a0\u00a0"), .envir = .envir) } #' @rdname ui #' @export ui_oops <- function(x, .envir = parent.frame()) { # Adding collapse = "\n " so that the text is aligned in multiple lines. - cli::cli_alert_danger(paste(x, collapse = "\n\u00a0\u00a0"), .envir = .envir) + if (!is_quiet()) cli::cli_alert_danger(paste(x, collapse = "\n\u00a0\u00a0"), .envir = .envir) } #' @rdname ui diff --git a/tests/testthat/_snaps/tidyverse.md b/tests/testthat/_snaps/tidyverse.md index f1c06ab4f..ab0219add 100644 --- a/tests/testthat/_snaps/tidyverse.md +++ b/tests/testthat/_snaps/tidyverse.md @@ -12,11 +12,5 @@ v Adding "@importFrom glue glue" to 'R/{TESTPKG}-package.R' v Adding "@importFrom lifecycle deprecated" to 'R/{TESTPKG}-package.R' v Writing 'NAMESPACE' - v Creating 'man/figures/' - v Copied SVG badges to 'man/figures/' - * Add badges in documentation topics by inserting one of: - #' `r lifecycle::badge('experimental')` - #' `r lifecycle::badge('superseded')` - #' `r lifecycle::badge('deprecated')` v Writing 'R/import-standalone-purrr.R'