Skip to content

use type checkers in aaa_models.R #1180

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

Merged
merged 1 commit into from
Sep 9, 2024
Merged

use type checkers in aaa_models.R #1180

merged 1 commit into from
Sep 9, 2024

Conversation

simonpcouch
Copy link
Contributor

@simonpcouch simonpcouch commented Sep 9, 2024

Closes #1179!

msg <- "{.arg func} should be a named vector with element {.field fun} and \\
the optional elements {.field pkg}, {.field range}, {.field trans}, \\
and {.field values}. {.field func} and {.field pkg} should both be \\
single character strings."

if (rlang::is_missing(func) || !is.vector(func))
cli::cli_abort(msg)
if (rlang::is_missing(func) || !is.vector(func)) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This condition could be check_character() but the above message is a good bit more informative as to what func ought to look like.

Copy link
Member

@EmilHvitfeldt EmilHvitfeldt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

amazing!!

@simonpcouch simonpcouch merged commit 6699730 into main Sep 9, 2024
10 checks passed
@simonpcouch simonpcouch deleted the aaa-1179 branch September 9, 2024 16:40
Copy link

This pull request 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 26, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

transition to rlang type checkers in aaa_models.R
2 participants