tidymodels / rsample

Classes and functions to create and summarize resampling objects
https://rsample.tidymodels.org
Other
341 stars 66 forks source link

Use cli errors #457

Closed hfrick closed 2 months ago

hfrick commented 1 year ago

Most or all errors thrown in this package are made via rlang::abort(). We are transitioning to cli::cli_abort() to make use of the richer styling options for errors via cli (which calls rlang under the hood).

It is often sufficient to search for and replace the rlang version with the cli version together with adding a little bit of styling.

Some examples of the styling possibilities are in the general introduction under the section of Inline text formatting. More details on inline formatting and pluralization.

One aspect to watch out for when transitioning from rlang::abort() to cli::cli_abort() are messages pre-assembled from user input as described here.

499 can serve as an example.

We are splitting this up into several batches:

hfrick commented 2 months ago

Closing this after all the tidy dev day PRs! Thank you @PriKalra @Dpananos and @JamesHWade!! 🙌

PriKalra commented 2 months ago

Thank you @hfrick for the patience and the opportunity! I will come back to support again!

github-actions[bot] commented 1 month ago

This issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with a reprex: https://reprex.tidyverse.org) and link to this issue.