if (FALSE) {
# will produce lints
code <- "
box::use(
path/to/module
)
"
lintr::lint(code, linters = box_unused_attached_mod_linter())
code <- "
box::use(
alias = path/to/module
)
"
lintr::lint(code, linters = box_unused_attached_mod_linter())
code <- "
box::use(
path/to/module[...]
)
"
lintr::lint(code, linters = box_unused_attached_mod_linter())
# okay
code <- "
box::use(
path/to/module
)
module$some_function()
"
lintr::lint(code, linters = box_unused_attached_mod_linter())
code <- "
box::use(
alias = path/to/module
)
alias$some_function()
"
lintr::lint(code, linters = box_unused_attached_mod_linter())
code <- "
box::use(
path/to/module[...] # module exports some_function()
)
some_function()
"
lintr::lint(code, linters = box_unused_attached_mod_linter())
}
Run the code above in your browser using DataLab