box
library unused attached module object linter
Source: R/box_unused_attached_mod_obj_linter.R
box_unused_att_mod_obj_linter.Rd
Checks that all attached module functions and data objects are used within the source file.
Details
For use in rhino
, see the
Explanation: Rhino style guide
to learn about the details.
Examples
if (FALSE) { # \dontrun{
# will produce lints
code <- "
box::use(
path/to/module[some_function, some_object],
)
"
lintr::lint(text = code, linters = box_unused_att_mod_obj_linter())
code <- "
box::use(
path/to/module[alias_func = some_function, alias_obj = some_object],
)
"
lintr::lint(text = code, linters = box_unused_att_mod_obj_linter())
# okay
code <- "
box::use(
path/to/module[some_function, some_object],
)
x <- sum(some_object)
some_function()
"
lintr::lint(text = code, linters = box_unused_att_mod_obj_linter())
code <- "
box::use(
path/to/module[alias_func = some_function, alias_obj = some_object],
)
x <- sum(alias_obj)
alias_func()
"
lintr::lint(text = code, linters = box_unused_att_mod_obj_linter())
} # }