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
2 changes: 0 additions & 2 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,10 @@ export(vroom_write)
export(vroom_write_lines)
import(rlang)
importFrom(bit64,integer64)
importFrom(crayon,blue)
importFrom(crayon,bold)
importFrom(crayon,cyan)
importFrom(crayon,green)
importFrom(crayon,reset)
importFrom(crayon,silver)
importFrom(glue,glue)
importFrom(lifecycle,deprecate_warn)
importFrom(lifecycle,deprecated)
Expand Down
26 changes: 13 additions & 13 deletions R/col_types.R
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ print.col_spec <- function(
x,
n = Inf,
condense = NULL,
colour = crayon::has_color(),
colour = cli::num_ansi_colors() > 1,
...
) {
cat(format.col_spec(x, n = n, condense = condense, colour = colour, ...))
Expand Down Expand Up @@ -183,7 +183,7 @@ format.col_spec <- function(
x,
n = Inf,
condense = NULL,
colour = crayon::has_color(),
colour = cli::num_ansi_colors() > 1,
...
) {
if (n == 0) {
Expand Down Expand Up @@ -262,7 +262,7 @@ format.col_spec <- function(
out
}

colourise_cols <- function(cols, colourise = crayon::has_color()) {
colourise_cols <- function(cols, colourise = cli::num_ansi_colors() > 1) {
if (!isTRUE(colourise)) {
return(cols)
}
Expand All @@ -275,18 +275,18 @@ colourise_cols <- function(cols, colourise = crayon::has_color()) {
col_guess = cols[[i]],

col_character = ,
col_factor = crayon::red(cols[[i]]),
col_factor = cli::col_red(cols[[i]]),

col_logical = crayon::yellow(cols[[i]]),
col_logical = cli::col_yellow(cols[[i]]),

col_double = ,
col_integer = ,
col_big_integer = ,
col_number = green(cols[[i]]),
col_number = cli::col_green(cols[[i]]),

col_date = ,
col_datetime = ,
col_time = blue(cols[[i]])
col_time = cli::col_blue(cols[[i]])
)
}
cols
Expand Down Expand Up @@ -648,7 +648,7 @@ summary.col_spec <- function(

types <- format(vapply(names(type_counts), color_type, character(1)))
counts <- format(glue::glue("({type_counts})"), justify = "right")
col_width <- min(width - (crayon::col_nchar(types) + nchar(counts) + 4))
col_width <- min(width - (cli::ansi_nchar(types) + nchar(counts) + 4))
columns <- vapply(
split(names(object$cols), col_types),
function(x) glue::glue_collapse(x, ", ", width = col_width),
Expand All @@ -670,7 +670,7 @@ summary.col_spec <- function(
entries = glue::glue("{format(types)} {counts}: {columns}"),

'
{if (nzchar(delim)) paste(bold("Delimiter:"), glue::double_quote(delim)) else ""}
{if (nzchar(delim)) paste(cli::style_bold("Delimiter:"), glue::double_quote(delim)) else ""}
{entries*}


Expand Down Expand Up @@ -717,14 +717,14 @@ color_type <- function(type) {
switch(
type,
chr = ,
fct = crayon::red(type),
lgl = crayon::yellow(type),
fct = cli::col_red(type),
lgl = cli::col_yellow(type),
dbl = ,
int = ,
num = green(type),
num = cli::col_green(type),
date = ,
dttm = ,
time = blue(type),
time = cli::col_blue(type),
"???" = type
)
}
Expand Down
2 changes: 0 additions & 2 deletions R/vroom-package.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,10 @@
## usethis namespace: start
#' @import rlang
#' @importFrom bit64 integer64
#' @importFrom crayon blue
#' @importFrom crayon bold
#' @importFrom crayon cyan
#' @importFrom crayon green
#' @importFrom crayon reset
#' @importFrom crayon silver
#' @importFrom glue glue
#' @importFrom lifecycle deprecate_warn
#' @importFrom lifecycle deprecated
Expand Down
15 changes: 5 additions & 10 deletions R/vroom.R
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ pb_file_format <- function(filename) {
}

pb_width <- function(format) {
ansii_chars <- nchar(format) - crayon::col_nchar(format)
ansii_chars <- nchar(format) - cli::ansi_nchar(format)
getOption("width", 80L) + ansii_chars
}

Expand Down Expand Up @@ -436,15 +436,10 @@ guess_delim <- function(lines, delims = c(",", "\t", " ", "|", ":", ";")) {
}
}
if (top_idx == 0) {
stop(
glue::glue(
'
Could not guess the delimiter.\n
{silver("Use `vroom(delim =)` to specify one explicitly.")}
'
),
call. = FALSE
)
cli::cli_abort(c(
"Could not guess the delimiter.",
"i" = "Use {.code vroom(delim =)} to specify one explicitly."
))
}

delims[[top_idx]]
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-datetime.R
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ test_that("offsets can cross date boundaries", {
})

test_that("unambiguous times with and without daylight savings", {
skip("Not working on CI")
skip_on_ci()
skip_on_cran() # need to figure out why this fails

melb <- locale(tz = "Australia/Melbourne")
Expand Down
Loading