# defaults for which functions are considered undesirable
names(default_undesirable_operators)
# will produce lints
lint(
text = "a <<- log(10)",
linters = undesirable_operator_linter()
)
lint(
text = "mtcars$wt",
linters = undesirable_operator_linter(op = c("$" = "As an alternative, use the `[[` accessor."))
)
# okay
lint(
text = "a <- log(10)",
linters = undesirable_operator_linter()
)
lint(
text = 'mtcars[["wt"]]',
linters = undesirable_operator_linter(op = c("$" = NA))
)
lint(
text = 'mtcars[["wt"]]',
linters = undesirable_operator_linter(op = c("$" = "As an alternative, use the `[[` accessor."))
)
Run the code above in your browser using DataLab