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} for error messages #1081

Closed
9 tasks done
EmilHvitfeldt opened this issue Mar 9, 2024 · 3 comments · Fixed by #1162
Closed
9 tasks done

Use {cli} for error messages #1081

EmilHvitfeldt opened this issue Mar 9, 2024 · 3 comments · Fixed by #1162
Labels
tidy-dev-day 🤓 Tidyverse Developer Day rstd.io/tidy-dev-day upkeep maintenance, infrastructure, and similar

Comments

@EmilHvitfeldt
Copy link
Member

EmilHvitfeldt commented Mar 9, 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).

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:

@simonpcouch
Copy link
Contributor

9/9 done! Huzzah!

@simonpcouch
Copy link
Contributor

I was a bit too eager in closing this—will reopen and later close with one last PR for the stray remaining ones.

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 13, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
tidy-dev-day 🤓 Tidyverse Developer Day rstd.io/tidy-dev-day upkeep maintenance, infrastructure, and similar
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants