r7kamura / rspec-json_matcher

RSpec matcher for testing JSON string
MIT License
171 stars 10 forks source link

Auto-correct Style/TrailingCommaInArrayLiteral #27

Closed github-actions[bot] closed 2 years ago

github-actions[bot] commented 2 years ago

Summary

Auto-corrected Style/TrailingCommaInArrayLiteral.

Details

Style/TrailingCommaInArrayLiteral

This cop checks for trailing comma in array literals. The configuration options are:

  • consistent_comma: Requires a comma after the last item of all non-empty, multiline array literals.
  • comma: Requires a comma after last item in an array, but only when each item is on its own line.
  • no_comma: Does not require a comma after the last item in an array

Examples

EnforcedStyleForMultiline: consistent_comma

# bad
a = [1, 2,]

# good
a = [1, 2]

# good
a = [
  1, 2,
  3,
]

# good
a = [
  1, 2, 3,
]

# good
a = [
  1,
  2,
]

EnforcedStyleForMultiline: comma

# bad
a = [1, 2,]

# good
a = [1, 2]

# bad
a = [
  1, 2,
  3,
]

# good
a = [
  1, 2,
  3
]

# bad
a = [
  1, 2, 3,
]

# good
a = [
  1, 2, 3
]

# good
a = [
  1,
  2,
]

EnforcedStyleForMultiline: no_comma (default)

# bad
a = [1, 2,]

# good
a = [
  1,
  2
]

Note

This pull request was generated by rubocop_todo_corrector.