Skip to content

Commit

Permalink
Set Style/TrailingCommaInArguments's EnforcedStyleForMultiline to comma
Browse files Browse the repository at this point in the history
Differently from the Hash and Array versions of this rule, this one
uses the existence of parentheses to determine if a comma is needed
or not, not if the method is multiline. As our style guide require
parentheses for all method calls, so this rule can't use the
consistent_comma option.
  • Loading branch information
rafaelfranca committed Sep 13, 2022
1 parent 71f6759 commit 3253231
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -709,7 +709,7 @@ Style/TrailingBodyOnMethodDefinition:
Enabled: false

Style/TrailingCommaInArguments:
EnforcedStyleForMultiline: consistent_comma
EnforcedStyleForMultiline: comma

Style/TrailingCommaInArrayLiteral:
EnforcedStyleForMultiline: consistent_comma
Expand Down
2 changes: 1 addition & 1 deletion test/config_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def test_config_is_unchanged
Rake::Task["config:dump"].invoke(tempfile.path)

diff = Diffy::Diff.new(
original_config, tempfile.path, source: "files", context: 5,
original_config, tempfile.path, source: "files", context: 5
).to_s

error_message = <<~ERROR
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/full_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3887,7 +3887,7 @@ Style/TrailingCommaInArguments:
StyleGuide: "#no-trailing-params-comma"
Enabled: true
VersionAdded: '0.36'
EnforcedStyleForMultiline: consistent_comma
EnforcedStyleForMultiline: comma
SupportedStylesForMultiline:
- comma
- consistent_comma
Expand Down

0 comments on commit 3253231

Please sign in to comment.