I was recently exploring the submission_tmpl() function and it looks like it's really useful! When I tried to run it the first time, I assumed that both hub_con, config_tasks, and round_id were all required (since they didn't have defaults), but I got this error:
Error in `hubValidations::submission_tmpl()`:
! Exactly one of `hub_con` or `config_tasks` must be supplied.
Run `rlang::last_trace()` to see where the error occurred.
Simple fix
Clearly state in the documentation that hub_con and config_tasks are mutually exclusive (e.g. in the arguments themselves).
This fix won't prevent people from doing what I did, but at least there will be a sign that instructs them about the right way to do it.
Robust fix
Make submission_tmpl() an S3 method for hub_connection and config classes and remove the config_tasks argument.
I consider this a more robust fix because the function really only needs the config be it accessed through a hub or the config object directly. We could even add a method for character objects to read from a file (it should probably be a path to a hub).
I was recently exploring the
submission_tmpl()
function and it looks like it's really useful! When I tried to run it the first time, I assumed that bothhub_con
,config_tasks
, andround_id
were all required (since they didn't have defaults), but I got this error:Simple fix
Clearly state in the documentation that
hub_con
andconfig_tasks
are mutually exclusive (e.g. in the arguments themselves).This fix won't prevent people from doing what I did, but at least there will be a sign that instructs them about the right way to do it.
Robust fix
Make
submission_tmpl()
an S3 method forhub_connection
andconfig
classes and remove theconfig_tasks
argument.I consider this a more robust fix because the function really only needs the config be it accessed through a hub or the config object directly. We could even add a method for
character
objects to read from a file (it should probably be a path to a hub).