-
Notifications
You must be signed in to change notification settings - Fork 129
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
Fix #320: ignore the magrittr
dot (.
)
#321
Conversation
Codecov Report
@@ Coverage Diff @@
## master #321 +/- ##
=====================================
Coverage 100% 100%
=====================================
Files 66 66
Lines 5176 5177 +1
=====================================
+ Hits 5176 5177 +1
Continue to review full report at Codecov.
|
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.
These look great to me. Also feel free to add me to the repo, if you think that will be helpful for the future.
Thanks, Alex! Kirill, free to chime in when it is convenient for you. |
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.
Thanks, makes sense to me.
@@ -357,14 +357,14 @@ find_globals <- function(expr){ | |||
} | |||
# Warning: In collector$results(reset = reset) : | |||
# partial argument match of 'reset' to 'resetState' | |||
|
|||
suppressWarnings(inputs <- CodeDepends::getInputs(expr)) | |||
base::union( | |||
inputs@inputs, | |||
names(inputs@functions) | |||
) %>% | |||
setdiff(y = c(formals, drake_fn_patterns)) %>% |
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.
Maybe just add the dot up there?
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.
Good catch. See 3ef462e.
Summary
From #320 and duncantl/CodeDepends#26, the
magrittr
dot (.
) is sometimes treated as a dependency even when it is just a placeholder symbol. Detection depends on the context of the rest of the code in the static analysis. In the case ofdrake
, this is a bit mysterious, and the behavior onmaster
may invalidate targets unpredictably.This PR forces (
.
) to never be a dependency, even when the user references it outside the intended tidyverse context. So if the user tries to reference (.
) in a command as an ordinary variable,drake
will still ignore it. That is fine with me because it is almost never something we should expect users to do and this PR documents it in the `caution.Rmd vignette. I think we should maximize consistency and minimize surprises.@AlexAxthelm, I wanted to add you as a reviewer for this PR, but I cannot request anyone outside the list. May I add you as a collaborator in the repo settings for subsequent PRs?
GitHub issues fixed
Checklist
drake
's code of conduct, and I agree to follow its rules.testthat
unit tests totests/testthat
to confirm that any new features or functionality work correctly.devtools::check()