Skip to contents

Report the use of undesirable functions, e.g. base::return(), base::options(), or base::sapply() and suggest an alternative.

Usage

undesirable_function_linter(
  fun = default_undesirable_functions,
  symbol_is_undesirable = TRUE
)

Arguments

fun

Named character vector. names(fun) correspond to undesirable functions, while the values give a description of why the function is undesirable. If NA, no additional information is given in the lint message. Defaults to default_undesirable_functions. To make small customizations to this list, use modify_defaults().

symbol_is_undesirable

Whether to consider the use of an undesirable function name as a symbol undesirable or not.

See also

linters for a complete list of linters available in lintr.