missing_argument
What it does
Checks for empty arguments in function calls, e.g. paste("a", , "b").
Why is this bad?
An empty argument left between commas is often a typo: a value was either deleted by mistake or never filled in. Depending on the function it can lead to an error or to a silently wrong result.
Several functions (e.g. mutate() in the tidyverse ecosystem) allow trailing commas. Those are ignored by default but you can also tweak this list of ignored functions in jarl.toml, see configuration options (below) for details.
This rule has no automatic fix.
Configuration options
The operation of the missing_argument rule can be customised in the configuration file.
Use skipped-functions to fully replace the default list of functions that are allowed to contain missing arguments. Use extend-skipped-functions to add to the default list. Specifying both is an error.
Function names in skipped-functions or extend-skipped-functions also match namespaced calls, e.g. skipped-functions = ["list2"] will ignore list2() and rlang::list2().
Default values
skipped-functions = [
"switch",
"tibble",
"list2",
"mutate",
"summarize",
"transmute",
]TOML settings
[lint]
...
[lint.missing_argument]
# Ignore missing arguments in `my_function()` only.
skipped-functions = ["my_function"]Example
paste("a", , "b")
mean(x, )Use instead:
paste("a", "b")
mean(x)(or add additional arguments).