Closed simonpcouch closed 1 week ago
Here are some examples I tested with:
# a longer one -----------------------------------------------------------------
extra_grid_params <- glue::single_quote(extra_grid_params)
extra_grid_params <- glue::glue_collapse(extra_grid_params, sep = ", ")
msg <- glue::glue(
"The provided `grid` has the following parameter columns that have ",
"not been marked for tuning by `tune()`: {extra_grid_params}."
)
rlang::abort(msg)
# a shorter one ----------------------------------------------------------------
some_thing <- paste0(some_other_thing, collapse = ", ")
stop(glue::glue("Here is {some_thing}."))
# indented inside of a function ------------------------------------------------
augment.data.frame <- function(x, data, ...) {
# only an issue when there's no trailing newline
stop(paste("augment's first argument should be a model, not a data.frame"))
}
# one that will be made to stretch across several lines ------------------------
stop("This is a message that is a super duper uber gloober wooper shoober duper foober pooper long.")
# some stuff after to make sure it doesn't get deleted
When testing, try highlighting both the whole final line and just the portion of the final line with the message to ensure there aren't off-by-ones due to trailing newlines.
hopefully no more off-by-one ๐ฅ๐นโ๏ธ๐งจ๐บ
Closes #8.