Skip to content

Missing function argument linter #563

Description

@renkun-ken

Although R allows missing argument in the following forms:

fun(x =)
fun(x=1,,2)
fun(1,)

such examples are almost always not intended in practice. For example, when editing the following list:

x <- list(
  a = 1,
  b = 2,
  c = 3
)

Removing c only will result in the following:

x <- list(
  a = 1,
  b = 2,
)

This is syntactically correct but will produce error at runtime.

A missing function argument linter will be useful to detect all these cases where (,, ,,, ,) or =) appear.

For matrix/array or data frame subsetting like mat[1,], arr[,1,2], df[, "col"], since using [ is not parsed as SYMBOL_FUNCTION_CALL, then the linter would by default not complain such usage.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions