Like require_naming_pattern but specifically for function names.
Usage
require_function_naming_pattern(
pattern,
message = "Function '{function}' does not follow naming convention.",
type = c("style", "warning", "error"),
invert = FALSE
)Examples
if (FALSE) { # \dontrun{
# Require functions to start with verb
verb_functions <- require_function_naming_pattern(
"^(get|set|calculate|check|is|has|create|update|delete)",
"Function '{function}' should start with a verb."
)
# Forbid functions with "temp" in name
no_temp_functions <- require_function_naming_pattern(
"temp",
"Function '{function}' should not contain 'temp'.",
invert = TRUE
)
} # }