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
)
See also
linters for a complete list of linters available in lintr.
Examples
# will produce lints
lint(
text = 'tibble(x = "a", )',
linters = missing_argument_linter()
)
#> <text>:1:17: style: [missing_argument_linter] Missing argument 2 in function call.
#> tibble(x = "a", )
#> ^
# okay
lint(
text = 'tibble(x = "a")',
linters = missing_argument_linter()
)
#> ℹ No lints found.
lint(
text = 'tibble(x = "a", )',
linters = missing_argument_linter(except = "tibble")
)
#> ℹ No lints found.
lint(
text = 'tibble(x = "a", )',
linters = missing_argument_linter(allow_trailing = TRUE)
)
#> ℹ No lints found.