-
-
Notifications
You must be signed in to change notification settings - Fork 7
Make as card check format #534
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
base: main
Are you sure you want to change the base?
Make as card check format #534
Conversation
|
✅ All contributors have signed the CLA |
|
I have read the CLA Document and I hereby sign the CLA |
087a156 to
f4f5ec2
Compare
R/check_ard_structure.R
Outdated
| .message_or_error( | ||
| "The following columns are expected to be list columns: {.val {not_a_lst_columns}}.", | ||
| error = error_on_fail, | ||
| envir = environment() |
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.
is this needed if default is rlang::current_env()?
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.
Yes, I made a change so that it used calling_env() instead, which works and now I no longer need to pass the environment explicitly.
R/utils.R
Outdated
| #' cards:::..warn_or_error("This will be a message", FALSE) | ||
| #' cards:::..warn_or_error("This will be an error", TRUE) |
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.
this should be message_or_error right?
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.
yes, and too many dots too! Fixed... the dangers of \donotrun ...
| #' Environment to evaluate the glue expressions in passed in `cli::cli_abort(message)`. | ||
| #' Default is `rlang::current_env()` | ||
| #' @inheritParams cli::cli_abort | ||
| #' @return Invisible NULL |
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 am not sure this is needed. Also it is internal
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.
This is consistent with the documentation above though?
Co-authored-by: Davide Garolini <dgarolini@gmail.com> Signed-off-by: Kieran Martin <kieranjmartin@gmail.com>
Co-authored-by: Davide Garolini <dgarolini@gmail.com> Signed-off-by: Kieran Martin <kieranjmartin@gmail.com>
Co-authored-by: Davide Garolini <dgarolini@gmail.com> Signed-off-by: Kieran Martin <kieranjmartin@gmail.com>
Co-authored-by: Davide Garolini <dgarolini@gmail.com> Signed-off-by: Kieran Martin <kieranjmartin@gmail.com>
Co-authored-by: Davide Garolini <dgarolini@gmail.com> Signed-off-by: Kieran Martin <kieranjmartin@gmail.com>
Co-authored-by: Davide Garolini <dgarolini@gmail.com> Signed-off-by: Kieran Martin <kieranjmartin@gmail.com>
Co-authored-by: Davide Garolini <dgarolini@gmail.com> Signed-off-by: Kieran Martin <kieranjmartin@gmail.com>
Co-authored-by: Davide Garolini <dgarolini@gmail.com> Signed-off-by: Kieran Martin <kieranjmartin@gmail.com>
Resolves #514
Incorportating
check_ard_structureintoas_cardproved to not be straight forwards asas_cardis used throughout the code base to coerce objects into a card class that do not pass the checks incheck_ard_structure.For now at least I did the following
check_ard_structurecan either error or warn based on user input. I made a function to switch between these (I couldn't see any function which existed to do this already). Part of me wonders about allowing the user a bit more control over what it considers an error or a warning; they can switch off caring about the column order, and whether there is a methods entry, but maybe we could allow more in future. That said I think it's probably better as a binary switch for a changeas_card, there is now an argument for whether you want to check if a card follows this structure. At the moment this defaults to TRUE, but if you think this is too strong I could switch it to default FALSE. Doing that would be the most low impact change.