Learn R Programming

lintr (version 3.1.2)

missing_argument_linter: Missing argument linter

Description

Check for missing arguments in function calls (e.g. stats::median(1:10, )).

Usage

missing_argument_linter(
  except = c("alist", "quote", "switch"),
  allow_trailing = FALSE
)

Arguments

except

a character vector of function names as exceptions.

allow_trailing

always allow trailing empty arguments?

Tags

common_mistakes, configurable, correctness

See Also

linters for a complete list of linters available in lintr.

Examples

Run this code
# will produce lints
lint(
  text = 'tibble(x = "a", )',
  linters = missing_argument_linter()
)

# okay
lint(
  text = 'tibble(x = "a")',
  linters = missing_argument_linter()
)

lint(
  text = 'tibble(x = "a", )',
  linters = missing_argument_linter(except = "tibble")
)

lint(
  text = 'tibble(x = "a", )',
  linters = missing_argument_linter(allow_trailing = TRUE)
)

Run the code above in your browser using DataLab