Skip to content

Commit

Permalink
Mildly improve visual hierarchy of devtools::check() (#2423)
Browse files Browse the repository at this point in the history
  • Loading branch information
hadley authored May 23, 2022
1 parent 047c91f commit c2637bd
Showing 1 changed file with 10 additions and 15 deletions.
25 changes: 10 additions & 15 deletions R/check.R
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,17 @@ check <- function(pkg = ".",

document <- document %||% can_document(pkg)
if (document) {
if (!quiet) {
cat_rule("Documenting", col = "cyan", line = 2)
}
document(pkg, quiet = quiet)
if (!quiet) {
cli::cat_line()
}
}

if (!quiet) {
cat_rule(
left = "Building",
right = pkg$package,
col = "cyan"
)
cat_rule("Building", col = "cyan", line = 2)
show_env_vars(pkgbuild::compiler_flags(FALSE))
}

Expand Down Expand Up @@ -207,12 +209,8 @@ check_built <- function(path = NULL, cran = TRUE,

env_vars <- check_env_vars(cran, remote, incoming, force_suggests, env_vars)
if (!quiet) {
cat_rule(
left = "Checking",
right = pkgname,
col = "cyan"
)
show_env_vars(env_vars, trailing = FALSE)
cat_rule("Checking", col = "cyan", line = 2)
show_env_vars(env_vars)
}

withr::with_envvar(env_vars, action = "replace", {
Expand Down Expand Up @@ -245,10 +243,7 @@ aspell_env_var <- function() {
}, error = function(e) character())
}

show_env_vars <- function(env_vars, trailing = TRUE) {
show_env_vars <- function(env_vars) {
cli::cat_line("Setting env vars:", col = "darkgrey")
cat_bullet(paste0(format(names(env_vars)), ": ", unname(env_vars)), col = "darkgrey")
if (trailing) {
cat_rule(col = "cyan")
}
}

0 comments on commit c2637bd

Please sign in to comment.