check_function_layout {cleanr}R Documentation

Check a Function's Layout

Description

Run all function_checks on a function.

Usage

check_function_layout(
  object,
  function_name = NULL,
  max_lines_of_code = get_cleanr_options("max_lines_of_code"),
  max_lines = get_cleanr_options("max_lines"),
  max_num_arguments = get_cleanr_options("max_num_arguments"),
  max_nesting_depth = get_cleanr_options("max_nesting_depth"),
  max_line_width = get_cleanr_options("max_line_width"),
  check_return = get_cleanr_options("check_return")
)

Arguments

object

The function to be checked.

function_name

The name to be used for reporting. Stick with the default: If NULL, it is taken from the object given. Argument is used internally to pass function names retrieved via get in the wrapper function check_functions_in_file.

max_lines_of_code

See check_num_lines_of_code.

max_lines

See check_num_lines.

max_num_arguments

See check_num_arguments.

max_nesting_depth

See check_nesting_depth.

max_line_width

See check_line_width.

check_return

See check_return.

Details

The functions catches the messages of "cleanr"-conditions thrown by function_checks and, if it caught any, throws them.

Value

Invisibly TRUE, but see Details.

See Also

Other wrappers: check_directory(), check_file_layout(), check_file(), check_functions_in_file(), check_package()

Examples

print(cleanr::check_function_layout(cleanr::check_num_lines))

[Package cleanr version 1.4.0 Index]