Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use cli errors in R/misc.R #509

Closed
Tracked by #457
hfrick opened this issue Jul 22, 2024 · 1 comment · Fixed by #529
Closed
Tracked by #457

Use cli errors in R/misc.R #509

hfrick opened this issue Jul 22, 2024 · 1 comment · Fixed by #529
Labels
feature a feature request or enhancement tidy-dev-day 🤓 Tidyverse Developer Day rstd.io/tidy-dev-day

Comments

@hfrick
Copy link
Member

hfrick commented Jul 22, 2024

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). This issue is part of that effort (#457).

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.

@hfrick hfrick mentioned this issue Jul 22, 2024
11 tasks
@hfrick hfrick changed the title R/misc.R Use cli errors in R/misc.R Jul 22, 2024
@hfrick hfrick added the tidy-dev-day 🤓 Tidyverse Developer Day rstd.io/tidy-dev-day label Jul 22, 2024
@hfrick hfrick added the feature a feature request or enhancement label Jul 31, 2024
Copy link

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.

@github-actions github-actions bot locked and limited conversation to collaborators Sep 27, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature a feature request or enhancement tidy-dev-day 🤓 Tidyverse Developer Day rstd.io/tidy-dev-day
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant