View source: R/box_unused_attached_mod_linter.R
box_unused_attached_mod_linter | R Documentation |
box
library unused attached module linterChecks that all attached modules are used within the source file. This also covers modules
attached using the ...
.
box_unused_attached_mod_linter()
For use in rhino
, see the
Explanation: Rhino style guide
to learn about the details.
A custom linter function for use with r-lib/lintr
.
## Not run:
# 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())
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.