-
Notifications
You must be signed in to change notification settings - Fork 8
Decide on whether/when to use ::
vs. @importFrom
(vs. both); apply, follow/enforce
#112
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
Comments
Just collecting some personal thoughts to add to the conversation
|
Some comments:
|
More importantly on 4., if the |
Another note here: we need to |
The #' @method predict cv.glmnet
#' @export Otherwise, the |
(one more point here: mocking can have more issues / require more boilerplate if we use |
Currently we have a mix of
::
and@importFrom
that doesn't seem to follow a convention, or at least an explicit one. This makes it harder to check for namespace issues, and easier to get distracted by "false positives" when reading code that switches from code using::
to@importFrom
[, and makes it harder to use test doubles correctly]. We should decide on a convention, apply it to existing code, and follow/enforce it moving forward.A couple cases to consider:
stats
conflicts (filter
,lag
):::
(in combination with@importFrom
or by itself) will help them avoid errors. It also allows us to copy-paste code into examples and vignettes without having to think as much, and is friendlier to users that want to use a::
-only style.lag
conflict where somedevtools
function (it was eitherdevtools::check
,devtools::run_examples
, or both) would only flag/encounter the issue if starting from a fresh session that didn't havedplyr
attached as a result of running other / the same dplyr commands.@importFrom
,%binop% = upstreampkg::`%binop%
without exporting, or%binop% = upstreampkg::`%binop%
with exporting.::
might become relevant.::
, but not if we use@importFrom
.]The text was updated successfully, but these errors were encountered: