class RuboCop::Cop::Style::TrailingCommaInArguments

)
2
1,
method(
# good
method(1, 2)
# good
method(1, 2,)
# bad
@example EnforcedStyleForMultiline: no_comma (default)
)
2,
1,
method(
# good
)
1, 2, 3
method(
# good
)
1, 2, 3,
method(
# bad
)
3
1, 2,
method(
# good
)
3,
1, 2,
method(
# bad
method(1, 2)
# good
method(1, 2,)
# bad
@example EnforcedStyleForMultiline: comma
)
2,
1,
method(
# good
)
1, 2, 3,
method(
# good
)
3,
1, 2,
method(
# good
method(1, 2)
# good
method(1, 2,)
# bad
@example EnforcedStyleForMultiline: consistent_comma
argument.
* ‘no_comma`: Requires that there is no comma after the last
parenthesized method calls where each argument is on its own line.
* `comma`: Requires a comma after the last argument, but only for
for all parenthesized method calls with arguments.
* `consistent_comma`: Requires a comma after the last argument,
The supported styles are:
This cop checks for trailing comma in argument lists.

def self.autocorrect_incompatible_with

def self.autocorrect_incompatible_with
  [Layout::HeredocArgumentClosingParenthesis]
end

def on_send(node)

def on_send(node)
  return unless node.arguments? && node.parenthesized?
  check(node, node.arguments, 'parameter of %<article>s method call',
        node.last_argument.source_range.end_pos,
        node.source_range.end_pos)
end