-
Notifications
You must be signed in to change notification settings - Fork 138
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
Add min_length
to check_character()
#1734
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be allow_empty
and apply to all vector types?
Could also be something like length = c("any", "non_empty", "scalar")
? It seems like this change deserves some discussion about general vector checks.
I agree. However I like the the proposed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Modify the stop_input_type()
call for:
what <- "character vector"
if (min_length > 0) {
what <- paste0(what, "of length greater or equal to", min_length)
}
allow_zero
to check_character()
min_length
to check_character()
Sometimes you want something non-empty.
allow_zero = FALSE
will disallowcharacter(0)
. Addresses #1618 (comment)