object_usage_linter {lintr} | R Documentation |
Object usage linter
Description
Check that closures have the proper usage using codetools::checkUsage()
.
Note that this runs base::eval()
on the code, so do not use with untrusted code.
Usage
object_usage_linter(interpret_glue = TRUE, skip_with = TRUE)
Arguments
interpret_glue |
If |
skip_with |
A logical. If |
Linters
The following linters are tagged with 'package_development':
See Also
linters for a complete list of linters available in lintr.
Examples
# will produce lints
lint(
text = "foo <- function() { x <- 1 }",
linters = object_usage_linter()
)
# okay
lint(
text = "foo <- function(x) { x <- 1 }",
linters = object_usage_linter()
)
lint(
text = "foo <- function() { x <- 1; return(x) }",
linters = object_usage_linter()
)
[Package lintr version 3.1.2 Index]