-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Closed
Labels
staleIssues that haven't been active in a whileIssues that haven't been active in a while
Description
Rubocop has several style cops related to trailing commas. The meaning of trailing commas is often to allow adding new method arguments or structure elements without changing previous ones.
However, having syntax like this I won't be able to add new argument at the end without changing lines with existing arguments.
Should we disable comma before closing brackets?
Expected behavior
Commas right before closing brackets should not be allowed
Actual behavior
some_method(a: "b",
c: "d",)
is a valid syntax
Steps to reproduce the problem
- Use this cop
Style/TrailingCommaInArguments:
EnforcedStyleForMultiline: consistent_comma
- Add code described above
- Run rubocop
RuboCop version
$ bin/rubocop -V
1.31.2 (using Parser 3.1.2.0, rubocop-ast 1.18.0, running on ruby 3.1.2 x86_64-darwin21)
- rubocop-performance 1.11.5
- rubocop-rails 2.12.4
- rubocop-rspec 2.4.0
ngouy, xalmar, davidmyersdev and santi-h
Metadata
Metadata
Assignees
Labels
staleIssues that haven't been active in a whileIssues that haven't been active in a while