View source: R/object_usage_linter.R
object_usage_linter | R Documentation |
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.
object_usage_linter(interpret_glue = TRUE, skip_with = TRUE)
interpret_glue |
If |
skip_with |
A logical. If |
The following linters are tagged with 'package_development':
backport_linter
conjunct_test_linter
expect_comparison_linter
expect_identical_linter
expect_length_linter
expect_named_linter
expect_not_linter
expect_null_linter
expect_s3_class_linter
expect_s4_class_linter
expect_true_false_linter
expect_type_linter
package_hooks_linter
yoda_test_linter
linters for a complete list of linters available in lintr.
# 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()
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.