Closed orgadish closed 7 months ago
I think there may be plans to create a new package for that: https://github.com/tidyverse/design/issues/160#issuecomment-1664166965
But meanwhile, in your packages, you can use
usethis::use_standalone("r-lib/rlang", "type-check")
See ggplot2 https://github.com/tidyverse/ggplot2/blob/main/R/import-standalone-types-check.R
https://usethis.r-lib.org/reference/use_standalone.html?q=use_sta#null
Thanks for the use_standalone
tip!
I hope tidyverse/design#160 goes through!
rlang
has an excellent set ofcheck_XXX
functions with tailored error messages. It would be great if this were available (and maintained) for public use -- in my mind, this would supersedeassertthat
, which has not been updated in over 4 years (orvec_assert
which is lifecycle: questioning).Alternatively, these could be exported using a single function (e.g.
rlang::check
) which takes one of the already exportedrlang::is_
functions and generates a good error message. e.g.rlang::check(x, rlang::is_string, allow_null = FALSE, allow_na = TRUE)
Related to discussion in r-lib/rlang#1111