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

Mrc 5429 - warn on "..." specified for null driver in hipercow_init #135

Merged
merged 7 commits into from
Jul 9, 2024

Conversation

weshinsley
Copy link
Contributor

No description provided.

@weshinsley weshinsley requested a review from richfitz July 5, 2024 18:34
@weshinsley weshinsley requested a review from plietar July 5, 2024 18:36
R/root.R Outdated
@@ -24,6 +24,16 @@
##' path <- withr::local_tempfile()
##' hipercow_init(path)
hipercow_init <- function(root = ".", driver = NULL, ...) {
if ((is.null(driver)) && (length(list(...)) > 0)) {
Copy link
Member

Choose a reason for hiding this comment

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

Perhaps look into rlang::check_dots_used (https://rlang.r-lib.org/reference/check_dots_used.html) which might do this for us?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is the possibility of...

if (is.null(driver)) {
rlang::check_dots_empty()
}

but converting this from an error to a warning, and including a message to say why

! ... must be empty.

only applies when driver = NULL was a bit fiddly.

R/root.R Outdated Show resolved Hide resolved
@weshinsley weshinsley requested a review from richfitz July 8, 2024 16:29
R/root.R Outdated Show resolved Hide resolved
@weshinsley weshinsley requested a review from richfitz July 8, 2024 20:10
@richfitz richfitz merged commit baac603 into main Jul 9, 2024
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants