Repository navigation
Add namespace_linter - #551
Conversation
AshesITR
left a comment
There was a problem hiding this comment.
travis logs report that devtools::document() is needed
Running |
|
It just occurred to me that a lint for unneeded ":::" would also be useful Do you mind adding that case? |
|
It's fine for me. We could document() on master first and merge back if that helps keep the PR diff focussed? |
|
Unneeded |
|
Now |
|
I send #553 and once it is merged, then existing PRs could merge back to keep the PR clean. |
|
I'll check the T_and_F_symbol_linter |
|
Okay weird, |
| ops <- xml2::xml_text(ns_nodes) | ||
| syms <- get_node_text(sym_nodes) | ||
|
|
||
| installed_packages <- .packages(all.available = TRUE) |
There was a problem hiding this comment.
I think I would prefer if this were a linter with options (function factory), and we can supply installed_packages externally (defaulting to what's used here).
would make this linter more useful in a broader set of use cases
There was a problem hiding this comment.
OK. The most general form could be user supplied installed packages. The use case might be customized library location, or a limited set of packages to check against instead of all currently installed packages, or pretend some packages are installed. I think this makes sense. Let me create a PR to make changes for both namespace_linter and missing_package_linter.
There was a problem hiding this comment.
As for namespace_linter, if some packages in user supplied packages are not actually installed or the library path is different from the current session that runs the linter, then getNamespace() and other namespace functions won't work so that the linter will think the symbols after :: and ::: are not available and complain. How do you think it should behave?
Closes #548
::and:::):::