class RuboCop::Cop::Style::TrailingCommaInArguments

Checks for trailing comma in argument lists. The supported styles are:

for all parenthesized multi-line method calls with arguments.

parenthesized method calls where each argument is on its own line.

argument.

Regardless of style, trailing commas are not allowed in single-line method calls.

@example EnforcedStyleForMultiline: consistent_comma

# bad
method(1, 2,)

# good
method(1, 2)

# good
method(
  1, 2,
  3,
)

# good
method(
  1, 2, 3,
)

# good
method(
  1,
  2,
)

@example EnforcedStyleForMultiline: comma

# bad
method(1, 2,)

# good
method(1, 2)

# bad
method(
  1, 2,
  3,
)

# good
method(
  1, 2,
  3
)

# bad
method(
  1, 2, 3,
)

# good
method(
  1, 2, 3
)

# good
method(
  1,
  2,
)

@example EnforcedStyleForMultiline: no_comma (default)

# bad
method(1, 2,)

# bad
object[1, 2,]

# good
method(1, 2)

# good
object[1, 2]

# good
method(
  1,
  2
)