Browse Source

fix RuboCop error (#7442)

* fix RuboCop error

RuboCop doesn't work by following error.

```
$ rubocop
Error: The `Style/TrailingCommaInLiteral` cop no longer exists. Please use `Style/TrailingCommaInArrayLiteral` and/or `Style/TrailingCommaInHashLiteral` instead.
(obsolete configuration found in .rubocop.yml, please update it)
```

it comes from RuboCop 0.53.0 [\[Fix #3394\] Separate Array & Hash Literal Comma configuration by garettarrowood · Pull Request #5307 · bbatsov/rubocop](https://github.com/bbatsov/rubocop/pull/5307)

* ci(CodeClimate): specify RuboCop version 0.54

 * https://docs.codeclimate.com/docs/rubocop#section-using-rubocop-s-newer-versions
 * [RuboCop 0.55.0 is not available yet](https://github.com/codeclimate/codeclimate-rubocop/issues/121) on CodeClimate rubocop channel
Chikahiro Tokoro 4 months ago
parent
commit
1637d24af4
2 changed files with 5 additions and 1 deletions
  1. 1
    0
      .codeclimate.yml
  2. 4
    1
      .rubocop.yml

+ 1
- 0
.codeclimate.yml View File

@@ -30,6 +30,7 @@ plugins:
30 30
     channel: eslint-4
31 31
   rubocop:
32 32
     enabled: true
33
+    channel: rubocop-0-54
33 34
   scss-lint:
34 35
     enabled: true
35 36
 exclude_patterns:

+ 4
- 1
.rubocop.yml View File

@@ -107,5 +107,8 @@ Style/RegexpLiteral:
107 107
 Style/SymbolArray:
108 108
   Enabled: false
109 109
 
110
-Style/TrailingCommaInLiteral:
110
+Style/TrailingCommaInArrayLiteral:
111
+  EnforcedStyleForMultiline: 'comma'
112
+
113
+Style/TrailingCommaInHashLiteral:
111 114
   EnforcedStyleForMultiline: 'comma'