Skip to content

A new linter checking duplicate arguments #850

@renkun-ken

Description

@renkun-ken

It is almost always a mistake to call a function with duplicate arguments, i.e. arguments of the same name, like the following:

foo(bar1 = 1, bar1 = 2, bar3 = 3)

Therefore, in most cases, it might make sense to check all function calls and ensure there are no duplicate arguments.

One use case of duplicate argument is to produce some table that actually needs duplicate headers for demonstration in documents, e.g.

data <- data.frame(
  mean = 1:5,
  sd = 0.5,
  mean = 2:6,
  sd = 1,
  check.names = FALSE
)

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