codeclimate 0.16.3 → 0.16.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2db11d7dedcb9b02f452d68f43d254a22b8ba94b
4
- data.tar.gz: 5a7a77a0a5c048011d536af021a31824b42632d2
3
+ metadata.gz: 9ab8216c3a1373b8d75254f56b2fb7fcdf643995
4
+ data.tar.gz: 80121ff6a75bde7d9c11b1f9f30bfa8006f1809a
5
5
  SHA512:
6
- metadata.gz: 4eae5e5cdf75677c9c9a806cab0577c629d2c1c997fb81d7da019d16f24b1e2907606d85bc44ec099c28c4ddf4016230825996f52034b9a030442ae78cb42ba1
7
- data.tar.gz: d356cb249030c8cb92240be787bd8e2c56d3aff8cee37317256906aa9b338159f38c36ccbde6354dc7f6b143337b35f85cb78afd7bf9cfc913d4ecfffeb85a42
6
+ metadata.gz: 80a0af751e5c3ac6a84062bd799a5cd9aa59cd15c5441c2748c21f75291d7b5b903be4ed750039ab8ba139362c9954375dbc701ca3f9743a91820fb01144ad98
7
+ data.tar.gz: 8d1f33d23814802fe1f2905ccd9f6af6b22c83a56d0b7de0ad1269163b843104e098d30976e2e2d284ff80fb57e090c188571a1ddd0759579d2f573af8bc4776
@@ -54,14 +54,14 @@ duplication:
54
54
  image: codeclimate/codeclimate-duplication
55
55
  description: Structural duplication detection for Ruby, Python, JavaScript, and PHP.
56
56
  community: false
57
- # enable_regexps:
58
- # - \.inc$
59
- # - \.js$
60
- # - \.jsx$
61
- # - \.module$
62
- # - \.php$
63
- # - \.py$
64
- # - \.rb$
57
+ enable_regexps:
58
+ - \.inc$
59
+ - \.js$
60
+ - \.jsx$
61
+ - \.module$
62
+ - \.php$
63
+ - \.py$
64
+ - \.rb$
65
65
  default_ratings_paths:
66
66
  - "**.inc"
67
67
  - "**.js"
@@ -1 +1 @@
1
- **/*.min.js
1
+ **/*{.,-}min.js
@@ -1,1171 +1,1168 @@
1
- # Disable all checks not explicitly referenced in this file
2
- # This is used to easily disable Style/* checks
3
1
  AllCops:
4
2
  DisabledByDefault: true
5
3
 
6
- ################## STYLE #################################
4
+ #################### Lint ################################
7
5
 
8
- Style/AccessModifierIndentation:
9
- Description: Check indentation of private/protected visibility modifiers.
10
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#indent-public-private-protected'
11
- Enabled: false
6
+ Lint/AmbiguousOperator:
7
+ Description: >-
8
+ Checks for ambiguous operators in the first argument of a
9
+ method invocation without parentheses.
10
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#parens-as-args'
11
+ Enabled: true
12
12
 
13
- Style/AccessorMethodName:
14
- Description: Check the naming of accessor methods for get_/set_.
15
- Enabled: false
13
+ Lint/AmbiguousRegexpLiteral:
14
+ Description: >-
15
+ Checks for ambiguous regexp literals in the first argument of
16
+ a method invocation without parenthesis.
17
+ Enabled: true
16
18
 
17
- Style/Alias:
18
- Description: 'Use alias_method instead of alias.'
19
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#alias-method'
20
- Enabled: false
19
+ Lint/AssignmentInCondition:
20
+ Description: "Don't use assignment in conditions."
21
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#safe-assignment-in-condition'
22
+ Enabled: true
21
23
 
22
- Style/AlignArray:
23
- Description: >-
24
- Align the elements of an array literal if they span more than
25
- one line.
26
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#align-multiline-arrays'
27
- Enabled: false
24
+ Lint/BlockAlignment:
25
+ Description: 'Align block ends correctly.'
26
+ Enabled: true
28
27
 
29
- Style/AlignHash:
30
- Description: >-
31
- Align the elements of a hash literal if they span more than
32
- one line.
33
- Enabled: false
28
+ Lint/CircularArgumentReference:
29
+ Description: "Don't refer to the keyword argument in the default value."
30
+ Enabled: true
34
31
 
35
- Style/AlignParameters:
32
+ Lint/ConditionPosition:
36
33
  Description: >-
37
- Align the parameters of a method call if they span more
38
- than one line.
39
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-double-indent'
40
- Enabled: false
34
+ Checks for condition placed in a confusing position relative to
35
+ the keyword.
36
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#same-line-condition'
37
+ Enabled: true
41
38
 
42
- Style/AndOr:
43
- Description: 'Use &&/|| instead of and/or.'
44
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-and-or-or'
45
- Enabled: false
39
+ Lint/Debugger:
40
+ Description: 'Check for debugger calls.'
41
+ Enabled: true
46
42
 
47
- Style/ArrayJoin:
48
- Description: 'Use Array#join instead of Array#*.'
49
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#array-join'
50
- Enabled: false
43
+ Lint/DefEndAlignment:
44
+ Description: 'Align ends corresponding to defs correctly.'
45
+ Enabled: true
51
46
 
52
- Style/AsciiComments:
53
- Description: 'Use only ascii symbols in comments.'
54
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#english-comments'
55
- Enabled: false
47
+ Lint/DeprecatedClassMethods:
48
+ Description: 'Check for deprecated class method calls.'
49
+ Enabled: true
56
50
 
57
- Style/AsciiIdentifiers:
58
- Description: 'Use only ascii symbols in identifiers.'
59
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#english-identifiers'
60
- Enabled: false
51
+ Lint/DuplicateMethods:
52
+ Description: 'Check for duplicate methods calls.'
53
+ Enabled: true
61
54
 
62
- Style/Attr:
63
- Description: 'Checks for uses of Module#attr.'
64
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#attr'
65
- Enabled: false
55
+ Lint/EachWithObjectArgument:
56
+ Description: 'Check for immutable argument given to each_with_object.'
57
+ Enabled: true
66
58
 
67
- Style/BeginBlock:
68
- Description: 'Avoid the use of BEGIN blocks.'
69
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-BEGIN-blocks'
70
- Enabled: false
59
+ Lint/ElseLayout:
60
+ Description: 'Check for odd code arrangement in an else block.'
61
+ Enabled: true
71
62
 
72
- Style/BarePercentLiterals:
73
- Description: 'Checks if usage of %() or %Q() matches configuration.'
74
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-q-shorthand'
75
- Enabled: false
63
+ Lint/EmptyEnsure:
64
+ Description: 'Checks for empty ensure block.'
65
+ Enabled: true
76
66
 
77
- Style/BlockComments:
78
- Description: 'Do not use block comments.'
79
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-block-comments'
80
- Enabled: false
67
+ Lint/EmptyInterpolation:
68
+ Description: 'Checks for empty string interpolation.'
69
+ Enabled: true
81
70
 
82
- Style/BlockEndNewline:
83
- Description: 'Put end statement of multiline block on its own line.'
84
- Enabled: false
71
+ Lint/EndAlignment:
72
+ Description: 'Align ends correctly.'
73
+ Enabled: true
85
74
 
86
- Style/BlockDelimiters:
75
+ Lint/EndInMethod:
76
+ Description: 'END blocks should not be placed inside method definitions.'
77
+ Enabled: true
78
+
79
+ Lint/EnsureReturn:
80
+ Description: 'Do not use return in an ensure block.'
81
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-return-ensure'
82
+ Enabled: true
83
+
84
+ Lint/Eval:
85
+ Description: 'The use of eval represents a serious security risk.'
86
+ Enabled: true
87
+
88
+ Lint/FormatParameterMismatch:
89
+ Description: 'The number of parameters to format/sprint must match the fields.'
90
+ Enabled: true
91
+
92
+ Lint/HandleExceptions:
93
+ Description: "Don't suppress exception."
94
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#dont-hide-exceptions'
95
+ Enabled: true
96
+
97
+ Lint/InvalidCharacterLiteral:
87
98
  Description: >-
88
- Avoid using {...} for multi-line blocks (multiline chaining is
89
- always ugly).
90
- Prefer {...} over do...end for single-line blocks.
91
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#single-line-blocks'
92
- Enabled: false
99
+ Checks for invalid character literals with a non-escaped
100
+ whitespace character.
101
+ Enabled: true
93
102
 
94
- Style/BracesAroundHashParameters:
95
- Description: 'Enforce braces style around hash parameters.'
96
- Enabled: false
103
+ Lint/LiteralInCondition:
104
+ Description: 'Checks of literals used in conditions.'
105
+ Enabled: true
97
106
 
98
- Style/CaseEquality:
99
- Description: 'Avoid explicit use of the case equality operator(===).'
100
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-case-equality'
101
- Enabled: false
107
+ Lint/LiteralInInterpolation:
108
+ Description: 'Checks for literals used in interpolation.'
109
+ Enabled: true
102
110
 
103
- Style/CaseIndentation:
104
- Description: 'Indentation of when in a case/when/[else/]end.'
105
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#indent-when-to-case'
106
- Enabled: false
111
+ Lint/Loop:
112
+ Description: >-
113
+ Use Kernel#loop with break rather than begin/end/until or
114
+ begin/end/while for post-loop tests.
115
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#loop-with-break'
116
+ Enabled: true
107
117
 
108
- Style/CharacterLiteral:
109
- Description: 'Checks for uses of character literals.'
110
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-character-literals'
111
- Enabled: false
118
+ Lint/NestedMethodDefinition:
119
+ Description: 'Do not use nested method definitions.'
120
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-methods'
121
+ Enabled: true
112
122
 
113
- Style/ClassAndModuleCamelCase:
114
- Description: 'Use CamelCase for classes and modules.'
115
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#camelcase-classes'
116
- Enabled: false
123
+ Lint/NonLocalExitFromIterator:
124
+ Description: 'Do not use return in iterator to cause non-local exit.'
125
+ Enabled: true
117
126
 
118
- Style/ClassAndModuleChildren:
119
- Description: 'Checks style of children classes and modules.'
120
- Enabled: false
127
+ Lint/ParenthesesAsGroupedExpression:
128
+ Description: >-
129
+ Checks for method calls with a space before the opening
130
+ parenthesis.
131
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#parens-no-spaces'
132
+ Enabled: true
121
133
 
122
- Style/ClassCheck:
123
- Description: 'Enforces consistent use of `Object#is_a?` or `Object#kind_of?`.'
124
- Enabled: false
134
+ Lint/RequireParentheses:
135
+ Description: >-
136
+ Use parentheses in the method call to avoid confusion
137
+ about precedence.
138
+ Enabled: true
125
139
 
126
- Style/ClassMethods:
127
- Description: 'Use self when defining module/class methods.'
128
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#def-self-class-methods'
129
- Enabled: false
140
+ Lint/RescueException:
141
+ Description: 'Avoid rescuing the Exception class.'
142
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-blind-rescues'
143
+ Enabled: true
130
144
 
131
- Style/ClassVars:
132
- Description: 'Avoid the use of class variables.'
133
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-class-vars'
134
- Enabled: false
145
+ Lint/ShadowingOuterLocalVariable:
146
+ Description: >-
147
+ Do not use the same name as outer local variable
148
+ for block arguments or block local variables.
149
+ Enabled: true
135
150
 
136
- Style/ClosingParenthesisIndentation:
137
- Description: 'Checks the indentation of hanging closing parentheses.'
138
- Enabled: false
151
+ Lint/SpaceBeforeFirstArg:
152
+ Description: >-
153
+ Put a space between a method name and the first argument
154
+ in a method call without parentheses.
155
+ Enabled: true
139
156
 
140
- Style/ColonMethodCall:
141
- Description: 'Do not use :: for method call.'
142
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#double-colons'
143
- Enabled: false
157
+ Lint/StringConversionInInterpolation:
158
+ Description: 'Checks for Object#to_s usage in string interpolation.'
159
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-to-s'
160
+ Enabled: true
144
161
 
145
- Style/CommandLiteral:
146
- Description: 'Use `` or %x around command literals.'
147
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-x'
148
- Enabled: false
162
+ Lint/UnderscorePrefixedVariableName:
163
+ Description: 'Do not use prefix `_` for a variable that is used.'
164
+ Enabled: true
149
165
 
150
- Style/CommentAnnotation:
166
+ Lint/UnneededDisable:
151
167
  Description: >-
152
- Checks formatting of special comments
153
- (TODO, FIXME, OPTIMIZE, HACK, REVIEW).
154
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#annotate-keywords'
155
- Enabled: false
168
+ Checks for rubocop:disable comments that can be removed.
169
+ Note: this cop is not disabled when disabling all cops.
170
+ It must be explicitly disabled.
171
+ Enabled: true
156
172
 
157
- Style/CommentIndentation:
158
- Description: 'Indentation of comments.'
159
- Enabled: false
173
+ Lint/UnusedBlockArgument:
174
+ Description: 'Checks for unused block arguments.'
175
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars'
176
+ Enabled: true
160
177
 
161
- Style/ConstantName:
162
- Description: 'Constants should use SCREAMING_SNAKE_CASE.'
163
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#screaming-snake-case'
164
- Enabled: false
178
+ Lint/UnusedMethodArgument:
179
+ Description: 'Checks for unused method arguments.'
180
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars'
181
+ Enabled: true
165
182
 
166
- Style/DefWithParentheses:
167
- Description: 'Use def with parentheses when there are arguments.'
168
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#method-parens'
169
- Enabled: false
183
+ Lint/UnreachableCode:
184
+ Description: 'Unreachable code.'
185
+ Enabled: true
170
186
 
171
- Style/DeprecatedHashMethods:
172
- Description: 'Checks for use of deprecated Hash methods.'
173
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#hash-key'
174
- Enabled: false
187
+ Lint/UselessAccessModifier:
188
+ Description: 'Checks for useless access modifiers.'
189
+ Enabled: true
175
190
 
176
- Style/Documentation:
177
- Description: 'Document classes and non-namespace modules.'
178
- Enabled: false
191
+ Lint/UselessAssignment:
192
+ Description: 'Checks for useless assignment to a local variable.'
193
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars'
194
+ Enabled: true
179
195
 
180
- Style/DotPosition:
181
- Description: 'Checks the position of the dot in multi-line method calls.'
182
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#consistent-multi-line-chains'
183
- Enabled: false
196
+ Lint/UselessComparison:
197
+ Description: 'Checks for comparison of something with itself.'
198
+ Enabled: true
184
199
 
185
- Style/DoubleNegation:
186
- Description: 'Checks for uses of double negation (!!).'
187
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-bang-bang'
188
- Enabled: false
200
+ Lint/UselessElseWithoutRescue:
201
+ Description: 'Checks for useless `else` in `begin..end` without `rescue`.'
202
+ Enabled: true
189
203
 
190
- Style/EachWithObject:
191
- Description: 'Prefer `each_with_object` over `inject` or `reduce`.'
192
- Enabled: false
204
+ Lint/UselessSetterCall:
205
+ Description: 'Checks for useless setter call to a local variable.'
206
+ Enabled: true
193
207
 
194
- Style/ElseAlignment:
195
- Description: 'Align elses and elsifs correctly.'
196
- Enabled: false
208
+ Lint/Void:
209
+ Description: 'Possible use of operator/literal/variable in void context.'
210
+ Enabled: true
197
211
 
198
- Style/EmptyElse:
199
- Description: 'Avoid empty else-clauses.'
200
- Enabled: false
212
+ ###################### Metrics ####################################
201
213
 
202
- Style/EmptyLineBetweenDefs:
203
- Description: 'Use empty lines between defs.'
204
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#empty-lines-between-methods'
214
+ Metrics/AbcSize:
215
+ Description: >-
216
+ A calculated magnitude based on number of assignments,
217
+ branches, and conditions.
218
+ Reference: 'http://c2.com/cgi/wiki?AbcMetric'
205
219
  Enabled: false
220
+ Max: 20
206
221
 
207
- Style/EmptyLines:
208
- Description: "Don't use several empty lines in a row."
209
- Enabled: false
222
+ Metrics/BlockNesting:
223
+ Description: 'Avoid excessive block nesting'
224
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#three-is-the-number-thou-shalt-count'
225
+ Enabled: true
226
+ Max: 4
210
227
 
211
- Style/EmptyLinesAroundAccessModifier:
212
- Description: "Keep blank lines around access modifiers."
213
- Enabled: false
228
+ Metrics/ClassLength:
229
+ Description: 'Avoid classes longer than 250 lines of code.'
230
+ Enabled: true
231
+ Max: 250
214
232
 
215
- Style/EmptyLinesAroundBlockBody:
216
- Description: "Keeps track of empty lines around block bodies."
217
- Enabled: false
233
+ Metrics/CyclomaticComplexity:
234
+ Description: >-
235
+ A complexity metric that is strongly correlated to the number
236
+ of test cases needed to validate a method.
237
+ Enabled: true
218
238
 
219
- Style/EmptyLinesAroundClassBody:
220
- Description: "Keeps track of empty lines around class bodies."
239
+ Metrics/LineLength:
240
+ Description: 'Limit lines to 80 characters.'
241
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#80-character-limits'
221
242
  Enabled: false
222
243
 
223
- Style/EmptyLinesAroundModuleBody:
224
- Description: "Keeps track of empty lines around module bodies."
225
- Enabled: false
244
+ Metrics/MethodLength:
245
+ Description: 'Avoid methods longer than 30 lines of code.'
246
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#short-methods'
247
+ Enabled: true
248
+ Max: 30
226
249
 
227
- Style/EmptyLinesAroundMethodBody:
228
- Description: "Keeps track of empty lines around method bodies."
229
- Enabled: false
250
+ Metrics/ModuleLength:
251
+ Description: 'Avoid modules longer than 250 lines of code.'
252
+ Enabled: true
253
+ Max: 250
230
254
 
231
- Style/EmptyLiteral:
232
- Description: 'Prefer literals to Array.new/Hash.new/String.new.'
233
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#literal-array-hash'
234
- Enabled: false
255
+ Metrics/ParameterLists:
256
+ Description: 'Avoid parameter lists longer than three or four parameters.'
257
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#too-many-params'
258
+ Enabled: true
235
259
 
236
- Style/EndBlock:
237
- Description: 'Avoid the use of END blocks.'
238
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-END-blocks'
260
+ Metrics/PerceivedComplexity:
261
+ Description: >-
262
+ A complexity metric geared towards measuring complexity for a
263
+ human reader.
239
264
  Enabled: false
240
265
 
241
- Style/EndOfLine:
242
- Description: 'Use Unix-style line endings.'
243
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#crlf'
244
- Enabled: false
266
+ ##################### Performance #############################
245
267
 
246
- Style/EvenOdd:
247
- Description: 'Favor the use of Fixnum#even? && Fixnum#odd?'
248
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#predicate-methods'
249
- Enabled: false
268
+ Performance/Count:
269
+ Description: >-
270
+ Use `count` instead of `select...size`, `reject...size`,
271
+ `select...count`, `reject...count`, `select...length`,
272
+ and `reject...length`.
273
+ Enabled: true
250
274
 
251
- Style/ExtraSpacing:
252
- Description: 'Do not use unnecessary spacing.'
253
- Enabled: false
275
+ Performance/Detect:
276
+ Description: >-
277
+ Use `detect` instead of `select.first`, `find_all.first`,
278
+ `select.last`, and `find_all.last`.
279
+ Reference: 'https://github.com/JuanitoFatas/fast-ruby#enumerabledetect-vs-enumerableselectfirst-code'
280
+ Enabled: true
254
281
 
255
- Style/FileName:
256
- Description: 'Use snake_case for source file names.'
257
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#snake-case-files'
258
- Enabled: false
282
+ Performance/FlatMap:
283
+ Description: >-
284
+ Use `Enumerable#flat_map`
285
+ instead of `Enumerable#map...Array#flatten(1)`
286
+ or `Enumberable#collect..Array#flatten(1)`
287
+ Reference: 'https://github.com/JuanitoFatas/fast-ruby#enumerablemaparrayflatten-vs-enumerableflat_map-code'
288
+ Enabled: true
289
+ EnabledForFlattenWithoutParams: false
290
+ # If enabled, this cop will warn about usages of
291
+ # `flatten` being called without any parameters.
292
+ # This can be dangerous since `flat_map` will only flatten 1 level, and
293
+ # `flatten` without any parameters can flatten multiple levels.
259
294
 
260
- Style/InitialIndentation:
295
+ Performance/ReverseEach:
296
+ Description: 'Use `reverse_each` instead of `reverse.each`.'
297
+ Reference: 'https://github.com/JuanitoFatas/fast-ruby#enumerablereverseeach-vs-enumerablereverse_each-code'
298
+ Enabled: true
299
+
300
+ Performance/Sample:
261
301
  Description: >-
262
- Checks the indentation of the first non-blank non-comment line in a file.
263
- Enabled: false
302
+ Use `sample` instead of `shuffle.first`,
303
+ `shuffle.last`, and `shuffle[Fixnum]`.
304
+ Reference: 'https://github.com/JuanitoFatas/fast-ruby#arrayshufflefirst-vs-arraysample-code'
305
+ Enabled: true
264
306
 
265
- Style/FirstParameterIndentation:
266
- Description: 'Checks the indentation of the first parameter in a method call.'
267
- Enabled: false
307
+ Performance/Size:
308
+ Description: >-
309
+ Use `size` instead of `count` for counting
310
+ the number of elements in `Array` and `Hash`.
311
+ Reference: 'https://github.com/JuanitoFatas/fast-ruby#arraycount-vs-arraysize-code'
312
+ Enabled: true
268
313
 
269
- Style/FlipFlop:
270
- Description: 'Checks for flip flops'
271
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-flip-flops'
272
- Enabled: false
314
+ Performance/StringReplacement:
315
+ Description: >-
316
+ Use `tr` instead of `gsub` when you are replacing the same
317
+ number of characters. Use `delete` instead of `gsub` when
318
+ you are deleting characters.
319
+ Reference: 'https://github.com/JuanitoFatas/fast-ruby#stringgsub-vs-stringtr-code'
320
+ Enabled: true
273
321
 
274
- Style/For:
275
- Description: 'Checks use of for or each in multiline loops.'
276
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-for-loops'
277
- Enabled: false
322
+ ##################### Rails ##################################
278
323
 
279
- Style/FormatString:
280
- Description: 'Enforce the use of Kernel#sprintf, Kernel#format or String#%.'
281
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#sprintf'
324
+ Rails/ActionFilter:
325
+ Description: 'Enforces consistent use of action filter methods.'
282
326
  Enabled: false
283
327
 
284
- Style/GlobalVars:
285
- Description: 'Do not introduce global variables.'
286
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#instance-vars'
287
- Reference: 'http://www.zenspider.com/Languages/Ruby/QuickRef.html'
328
+ Rails/Date:
329
+ Description: >-
330
+ Checks the correct usage of date aware methods,
331
+ such as Date.today, Date.current etc.
288
332
  Enabled: false
289
333
 
290
- Style/GuardClause:
291
- Description: 'Check for conditionals that can be replaced with guard clauses'
292
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals'
334
+ Rails/DefaultScope:
335
+ Description: 'Checks if the argument passed to default_scope is a block.'
293
336
  Enabled: false
294
337
 
295
- Style/HashSyntax:
296
- Description: >-
297
- Prefer Ruby 1.9 hash syntax { a: 1, b: 2 } over 1.8 syntax
298
- { :a => 1, :b => 2 }.
299
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#hash-literals'
338
+ Rails/Delegate:
339
+ Description: 'Prefer delegate method for delegations.'
300
340
  Enabled: false
301
341
 
302
- Style/IfUnlessModifier:
303
- Description: >-
304
- Favor modifier if/unless usage when you have a
305
- single-line body.
306
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#if-as-a-modifier'
342
+ Rails/FindBy:
343
+ Description: 'Prefer find_by over where.first.'
307
344
  Enabled: false
308
345
 
309
- Style/IfWithSemicolon:
310
- Description: 'Do not use if x; .... Use the ternary operator instead.'
311
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-semicolon-ifs'
346
+ Rails/FindEach:
347
+ Description: 'Prefer all.find_each over all.find.'
312
348
  Enabled: false
313
349
 
314
- Style/IndentationConsistency:
315
- Description: 'Keep indentation straight.'
350
+ Rails/HasAndBelongsToMany:
351
+ Description: 'Prefer has_many :through to has_and_belongs_to_many.'
316
352
  Enabled: false
317
353
 
318
- Style/IndentationWidth:
319
- Description: 'Use 2 spaces for indentation.'
320
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-indentation'
354
+ Rails/Output:
355
+ Description: 'Checks for calls to puts, print, etc.'
321
356
  Enabled: false
322
357
 
323
- Style/IndentArray:
358
+ Rails/ReadWriteAttribute:
324
359
  Description: >-
325
- Checks the indentation of the first element in an array
326
- literal.
360
+ Checks for read_attribute(:attr) and
361
+ write_attribute(:attr, val).
327
362
  Enabled: false
328
363
 
329
- Style/IndentHash:
330
- Description: 'Checks the indentation of the first key in a hash literal.'
364
+ Rails/ScopeArgs:
365
+ Description: 'Checks the arguments of ActiveRecord scopes.'
331
366
  Enabled: false
332
367
 
333
- Style/InfiniteLoop:
334
- Description: 'Use Kernel#loop for infinite loops.'
335
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#infinite-loop'
368
+ Rails/TimeZone:
369
+ Description: 'Checks the correct usage of time zone aware methods.'
370
+ StyleGuide: 'https://github.com/bbatsov/rails-style-guide#time'
371
+ Reference: 'http://danilenko.org/2012/7/6/rails_timezones'
336
372
  Enabled: false
337
373
 
338
- Style/Lambda:
339
- Description: 'Use the new lambda literal syntax for single-line blocks.'
340
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#lambda-multi-line'
374
+ Rails/Validation:
375
+ Description: 'Use validates :attribute, hash of validations.'
341
376
  Enabled: false
342
377
 
343
- Style/LambdaCall:
344
- Description: 'Use lambda.call(...) instead of lambda.(...).'
345
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#proc-call'
346
- Enabled: false
378
+ ################## Style #################################
347
379
 
348
- Style/LeadingCommentSpace:
349
- Description: 'Comments should start with a space.'
350
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#hash-space'
380
+ Style/AccessModifierIndentation:
381
+ Description: Check indentation of private/protected visibility modifiers.
382
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#indent-public-private-protected'
351
383
  Enabled: false
352
384
 
353
- Style/LineEndConcatenation:
354
- Description: >-
355
- Use \ instead of + or << to concatenate two string literals at
356
- line end.
385
+ Style/AccessorMethodName:
386
+ Description: Check the naming of accessor methods for get_/set_.
357
387
  Enabled: false
358
388
 
359
- Style/MethodCallParentheses:
360
- Description: 'Do not use parentheses for method calls with no arguments.'
361
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-args-no-parens'
389
+ Style/Alias:
390
+ Description: 'Use alias_method instead of alias.'
391
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#alias-method'
362
392
  Enabled: false
363
393
 
364
- Style/MethodDefParentheses:
394
+ Style/AlignArray:
365
395
  Description: >-
366
- Checks if the method definitions have or don't have
367
- parentheses.
368
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#method-parens'
396
+ Align the elements of an array literal if they span more than
397
+ one line.
398
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#align-multiline-arrays'
369
399
  Enabled: false
370
400
 
371
- Style/MethodName:
372
- Description: 'Use the configured style when naming methods.'
373
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#snake-case-symbols-methods-vars'
401
+ Style/AlignHash:
402
+ Description: >-
403
+ Align the elements of a hash literal if they span more than
404
+ one line.
374
405
  Enabled: false
375
406
 
376
- Style/ModuleFunction:
377
- Description: 'Checks for usage of `extend self` in modules.'
378
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#module-function'
407
+ Style/AlignParameters:
408
+ Description: >-
409
+ Align the parameters of a method call if they span more
410
+ than one line.
411
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-double-indent'
379
412
  Enabled: false
380
413
 
381
- Style/MultilineBlockChain:
382
- Description: 'Avoid multi-line chains of blocks.'
383
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#single-line-blocks'
414
+ Style/AndOr:
415
+ Description: 'Use &&/|| instead of and/or.'
416
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-and-or-or'
384
417
  Enabled: false
385
418
 
386
- Style/MultilineBlockLayout:
387
- Description: 'Ensures newlines after multiline block do statements.'
419
+ Style/ArrayJoin:
420
+ Description: 'Use Array#join instead of Array#*.'
421
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#array-join'
388
422
  Enabled: false
389
423
 
390
- Style/MultilineIfThen:
391
- Description: 'Do not use then for multi-line if/unless.'
392
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-then'
424
+ Style/AsciiComments:
425
+ Description: 'Use only ascii symbols in comments.'
426
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#english-comments'
393
427
  Enabled: false
394
428
 
395
- Style/MultilineOperationIndentation:
396
- Description: >-
397
- Checks indentation of binary operations that span more than
398
- one line.
429
+ Style/AsciiIdentifiers:
430
+ Description: 'Use only ascii symbols in identifiers.'
431
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#english-identifiers'
399
432
  Enabled: false
400
433
 
401
- Style/MultilineTernaryOperator:
402
- Description: >-
403
- Avoid multi-line ?: (the ternary operator);
404
- use if/unless instead.
405
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-multiline-ternary'
434
+ Style/Attr:
435
+ Description: 'Checks for uses of Module#attr.'
436
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#attr'
406
437
  Enabled: false
407
438
 
408
- Style/NegatedIf:
409
- Description: >-
410
- Favor unless over if for negative conditions
411
- (or control flow or).
412
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#unless-for-negatives'
439
+ Style/BeginBlock:
440
+ Description: 'Avoid the use of BEGIN blocks.'
441
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-BEGIN-blocks'
413
442
  Enabled: false
414
443
 
415
- Style/NegatedWhile:
416
- Description: 'Favor until over while for negative conditions.'
417
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#until-for-negatives'
444
+ Style/BarePercentLiterals:
445
+ Description: 'Checks if usage of %() or %Q() matches configuration.'
446
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-q-shorthand'
418
447
  Enabled: false
419
448
 
420
- Style/NestedTernaryOperator:
421
- Description: 'Use one expression per branch in a ternary operator.'
422
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-ternary'
449
+ Style/BlockComments:
450
+ Description: 'Do not use block comments.'
451
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-block-comments'
423
452
  Enabled: false
424
453
 
425
- Style/Next:
426
- Description: 'Use `next` to skip iteration instead of a condition at the end.'
427
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals'
454
+ Style/BlockEndNewline:
455
+ Description: 'Put end statement of multiline block on its own line.'
428
456
  Enabled: false
429
457
 
430
- Style/NilComparison:
431
- Description: 'Prefer x.nil? to x == nil.'
432
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#predicate-methods'
458
+ Style/BlockDelimiters:
459
+ Description: >-
460
+ Avoid using {...} for multi-line blocks (multiline chaining is
461
+ always ugly).
462
+ Prefer {...} over do...end for single-line blocks.
463
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#single-line-blocks'
433
464
  Enabled: false
434
465
 
435
- Style/NonNilCheck:
436
- Description: 'Checks for redundant nil checks.'
437
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-non-nil-checks'
466
+ Style/BracesAroundHashParameters:
467
+ Description: 'Enforce braces style around hash parameters.'
438
468
  Enabled: false
439
469
 
440
- Style/Not:
441
- Description: 'Use ! instead of not.'
442
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#bang-not-not'
470
+ Style/CaseEquality:
471
+ Description: 'Avoid explicit use of the case equality operator(===).'
472
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-case-equality'
443
473
  Enabled: false
444
474
 
445
- Style/NumericLiterals:
446
- Description: >-
447
- Add underscores to large numeric literals to improve their
448
- readability.
449
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#underscores-in-numerics'
475
+ Style/CaseIndentation:
476
+ Description: 'Indentation of when in a case/when/[else/]end.'
477
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#indent-when-to-case'
450
478
  Enabled: false
451
479
 
452
- Style/OneLineConditional:
453
- Description: >-
454
- Favor the ternary operator(?:) over
455
- if/then/else/end constructs.
456
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#ternary-operator'
480
+ Style/CharacterLiteral:
481
+ Description: 'Checks for uses of character literals.'
482
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-character-literals'
457
483
  Enabled: false
458
484
 
459
- Style/OpMethod:
460
- Description: 'When defining binary operators, name the argument other.'
461
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#other-arg'
485
+ Style/ClassAndModuleCamelCase:
486
+ Description: 'Use CamelCase for classes and modules.'
487
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#camelcase-classes'
462
488
  Enabled: false
463
489
 
464
- Style/OptionalArguments:
465
- Description: >-
466
- Checks for optional arguments that do not appear at the end
467
- of the argument list
468
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#optional-arguments'
490
+ Style/ClassAndModuleChildren:
491
+ Description: 'Checks style of children classes and modules.'
469
492
  Enabled: false
470
493
 
471
- Style/ParallelAssignment:
472
- Description: >-
473
- Check for simple usages of parallel assignment.
474
- It will only warn when the number of variables
475
- matches on both sides of the assignment.
476
- This also provides performance benefits
477
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#parallel-assignment'
478
- Reference: 'https://github.com/JuanitoFatas/fast-ruby#parallel-assignment-vs-sequential-assignment-code'
494
+ Style/ClassCheck:
495
+ Description: 'Enforces consistent use of `Object#is_a?` or `Object#kind_of?`.'
479
496
  Enabled: false
480
497
 
481
- Style/ParenthesesAroundCondition:
482
- Description: >-
483
- Don't use parentheses around the condition of an
484
- if/unless/while.
485
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-parens-if'
498
+ Style/ClassMethods:
499
+ Description: 'Use self when defining module/class methods.'
500
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#def-self-class-methods'
486
501
  Enabled: false
487
502
 
488
- Style/PercentLiteralDelimiters:
489
- Description: 'Use `%`-literal delimiters consistently'
490
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-literal-braces'
503
+ Style/ClassVars:
504
+ Description: 'Avoid the use of class variables.'
505
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-class-vars'
491
506
  Enabled: false
492
507
 
493
- Style/PercentQLiterals:
494
- Description: 'Checks if uses of %Q/%q match the configured preference.'
508
+ Style/ClosingParenthesisIndentation:
509
+ Description: 'Checks the indentation of hanging closing parentheses.'
495
510
  Enabled: false
496
511
 
497
- Style/PerlBackrefs:
498
- Description: 'Avoid Perl-style regex back references.'
499
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-perl-regexp-last-matchers'
512
+ Style/ColonMethodCall:
513
+ Description: 'Do not use :: for method call.'
514
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#double-colons'
500
515
  Enabled: false
501
516
 
502
- Style/PredicateName:
503
- Description: 'Check the names of predicate methods.'
504
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#bool-methods-qmark'
517
+ Style/CommandLiteral:
518
+ Description: 'Use `` or %x around command literals.'
519
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-x'
505
520
  Enabled: false
506
521
 
507
- Style/Proc:
508
- Description: 'Use proc instead of Proc.new.'
509
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#proc'
522
+ Style/CommentAnnotation:
523
+ Description: >-
524
+ Checks formatting of special comments
525
+ (TODO, FIXME, OPTIMIZE, HACK, REVIEW).
526
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#annotate-keywords'
510
527
  Enabled: false
511
528
 
512
- Style/RaiseArgs:
513
- Description: 'Checks the arguments passed to raise/fail.'
514
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#exception-class-messages'
529
+ Style/CommentIndentation:
530
+ Description: 'Indentation of comments.'
515
531
  Enabled: false
516
532
 
517
- Style/RedundantBegin:
518
- Description: "Don't use begin blocks when they are not needed."
519
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#begin-implicit'
533
+ Style/ConstantName:
534
+ Description: 'Constants should use SCREAMING_SNAKE_CASE.'
535
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#screaming-snake-case'
520
536
  Enabled: false
521
537
 
522
- Style/RedundantException:
523
- Description: "Checks for an obsolete RuntimeException argument in raise/fail."
524
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-explicit-runtimeerror'
538
+ Style/DefWithParentheses:
539
+ Description: 'Use def with parentheses when there are arguments.'
540
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#method-parens'
525
541
  Enabled: false
526
542
 
527
- Style/RedundantReturn:
528
- Description: "Don't use return where it's not required."
529
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-explicit-return'
543
+ Style/DeprecatedHashMethods:
544
+ Description: 'Checks for use of deprecated Hash methods.'
545
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#hash-key'
530
546
  Enabled: false
531
547
 
532
- Style/RedundantSelf:
533
- Description: "Don't use self where it's not needed."
534
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-self-unless-required'
548
+ Style/Documentation:
549
+ Description: 'Document classes and non-namespace modules.'
535
550
  Enabled: false
536
551
 
537
- Style/RegexpLiteral:
538
- Description: 'Use / or %r around regular expressions.'
539
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-r'
552
+ Style/DotPosition:
553
+ Description: 'Checks the position of the dot in multi-line method calls.'
554
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#consistent-multi-line-chains'
540
555
  Enabled: false
541
556
 
542
- Style/RescueEnsureAlignment:
543
- Description: 'Align rescues and ensures correctly.'
557
+ Style/DoubleNegation:
558
+ Description: 'Checks for uses of double negation (!!).'
559
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-bang-bang'
544
560
  Enabled: false
545
561
 
546
- Style/RescueModifier:
547
- Description: 'Avoid using rescue in its modifier form.'
548
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-rescue-modifiers'
562
+ Style/EachWithObject:
563
+ Description: 'Prefer `each_with_object` over `inject` or `reduce`.'
549
564
  Enabled: false
550
565
 
551
- Style/SelfAssignment:
552
- Description: >-
553
- Checks for places where self-assignment shorthand should have
554
- been used.
555
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#self-assignment'
566
+ Style/ElseAlignment:
567
+ Description: 'Align elses and elsifs correctly.'
556
568
  Enabled: false
557
569
 
558
- Style/Semicolon:
559
- Description: "Don't use semicolons to terminate expressions."
560
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-semicolon'
570
+ Style/EmptyElse:
571
+ Description: 'Avoid empty else-clauses.'
561
572
  Enabled: false
562
573
 
563
- Style/SignalException:
564
- Description: 'Checks for proper usage of fail and raise.'
565
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#fail-method'
574
+ Style/EmptyLineBetweenDefs:
575
+ Description: 'Use empty lines between defs.'
576
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#empty-lines-between-methods'
566
577
  Enabled: false
567
578
 
568
- Style/SingleLineBlockParams:
569
- Description: 'Enforces the names of some block params.'
570
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#reduce-blocks'
579
+ Style/EmptyLines:
580
+ Description: "Don't use several empty lines in a row."
571
581
  Enabled: false
572
582
 
573
- Style/SingleLineMethods:
574
- Description: 'Avoid single-line methods.'
575
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-single-line-methods'
583
+ Style/EmptyLinesAroundAccessModifier:
584
+ Description: "Keep blank lines around access modifiers."
576
585
  Enabled: false
577
586
 
578
- Style/SingleSpaceBeforeFirstArg:
579
- Description: >-
580
- Checks that exactly one space is used between a method name
581
- and the first argument for method calls without parentheses.
587
+ Style/EmptyLinesAroundBlockBody:
588
+ Description: "Keeps track of empty lines around block bodies."
582
589
  Enabled: false
583
590
 
584
- Style/SpaceAfterColon:
585
- Description: 'Use spaces after colons.'
586
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-operators'
591
+ Style/EmptyLinesAroundClassBody:
592
+ Description: "Keeps track of empty lines around class bodies."
587
593
  Enabled: false
588
594
 
589
- Style/SpaceAfterComma:
590
- Description: 'Use spaces after commas.'
591
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-operators'
595
+ Style/EmptyLinesAroundModuleBody:
596
+ Description: "Keeps track of empty lines around module bodies."
592
597
  Enabled: false
593
598
 
594
- Style/SpaceAfterControlKeyword:
595
- Description: 'Use spaces after if/elsif/unless/while/until/case/when.'
599
+ Style/EmptyLinesAroundMethodBody:
600
+ Description: "Keeps track of empty lines around method bodies."
596
601
  Enabled: false
597
602
 
598
- Style/SpaceAfterMethodName:
599
- Description: >-
600
- Do not put a space between a method name and the opening
601
- parenthesis in a method definition.
602
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#parens-no-spaces'
603
+ Style/EmptyLiteral:
604
+ Description: 'Prefer literals to Array.new/Hash.new/String.new.'
605
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#literal-array-hash'
603
606
  Enabled: false
604
607
 
605
- Style/SpaceAfterNot:
606
- Description: Tracks redundant space after the ! operator.
607
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-space-bang'
608
+ Style/EndBlock:
609
+ Description: 'Avoid the use of END blocks.'
610
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-END-blocks'
608
611
  Enabled: false
609
612
 
610
- Style/SpaceAfterSemicolon:
611
- Description: 'Use spaces after semicolons.'
612
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-operators'
613
+ Style/EndOfLine:
614
+ Description: 'Use Unix-style line endings.'
615
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#crlf'
613
616
  Enabled: false
614
617
 
615
- Style/SpaceBeforeBlockBraces:
616
- Description: >-
617
- Checks that the left block brace has or doesn't have space
618
- before it.
618
+ Style/EvenOdd:
619
+ Description: 'Favor the use of Fixnum#even? && Fixnum#odd?'
620
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#predicate-methods'
619
621
  Enabled: false
620
622
 
621
- Style/SpaceBeforeComma:
622
- Description: 'No spaces before commas.'
623
+ Style/ExtraSpacing:
624
+ Description: 'Do not use unnecessary spacing.'
623
625
  Enabled: false
624
626
 
625
- Style/SpaceBeforeComment:
627
+ Style/FileName:
628
+ Description: 'Use snake_case for source file names.'
629
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#snake-case-files'
630
+ Enabled: false
631
+
632
+ Style/InitialIndentation:
626
633
  Description: >-
627
- Checks for missing space between code and a comment on the
628
- same line.
634
+ Checks the indentation of the first non-blank non-comment line in a file.
629
635
  Enabled: false
630
636
 
631
- Style/SpaceBeforeSemicolon:
632
- Description: 'No spaces before semicolons.'
637
+ Style/FirstParameterIndentation:
638
+ Description: 'Checks the indentation of the first parameter in a method call.'
633
639
  Enabled: false
634
640
 
635
- Style/SpaceInsideBlockBraces:
636
- Description: >-
637
- Checks that block braces have or don't have surrounding space.
638
- For blocks taking parameters, checks that the left brace has
639
- or doesn't have trailing space.
641
+ Style/FlipFlop:
642
+ Description: 'Checks for flip flops'
643
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-flip-flops'
640
644
  Enabled: false
641
645
 
642
- Style/SpaceAroundBlockParameters:
643
- Description: 'Checks the spacing inside and after block parameters pipes.'
646
+ Style/For:
647
+ Description: 'Checks use of for or each in multiline loops.'
648
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-for-loops'
644
649
  Enabled: false
645
650
 
646
- Style/SpaceAroundEqualsInParameterDefault:
647
- Description: >-
648
- Checks that the equals signs in parameter default assignments
649
- have or don't have surrounding space depending on
650
- configuration.
651
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-around-equals'
651
+ Style/FormatString:
652
+ Description: 'Enforce the use of Kernel#sprintf, Kernel#format or String#%.'
653
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#sprintf'
652
654
  Enabled: false
653
655
 
654
- Style/SpaceAroundOperators:
655
- Description: 'Use a single space around operators.'
656
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-operators'
656
+ Style/GlobalVars:
657
+ Description: 'Do not introduce global variables.'
658
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#instance-vars'
659
+ Reference: 'http://www.zenspider.com/Languages/Ruby/QuickRef.html'
657
660
  Enabled: false
658
661
 
659
- Style/SpaceBeforeModifierKeyword:
660
- Description: 'Put a space before the modifier keyword.'
662
+ Style/GuardClause:
663
+ Description: 'Check for conditionals that can be replaced with guard clauses'
664
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals'
661
665
  Enabled: false
662
666
 
663
- Style/SpaceInsideBrackets:
664
- Description: 'No spaces after [ or before ].'
665
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-spaces-braces'
667
+ Style/HashSyntax:
668
+ Description: >-
669
+ Prefer Ruby 1.9 hash syntax { a: 1, b: 2 } over 1.8 syntax
670
+ { :a => 1, :b => 2 }.
671
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#hash-literals'
666
672
  Enabled: false
667
673
 
668
- Style/SpaceInsideHashLiteralBraces:
669
- Description: "Use spaces inside hash literal braces - or don't."
670
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-operators'
674
+ Style/IfUnlessModifier:
675
+ Description: >-
676
+ Favor modifier if/unless usage when you have a
677
+ single-line body.
678
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#if-as-a-modifier'
671
679
  Enabled: false
672
680
 
673
- Style/SpaceInsideParens:
674
- Description: 'No spaces after ( or before ).'
675
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-spaces-braces'
681
+ Style/IfWithSemicolon:
682
+ Description: 'Do not use if x; .... Use the ternary operator instead.'
683
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-semicolon-ifs'
676
684
  Enabled: false
677
685
 
678
- Style/SpaceInsideRangeLiteral:
679
- Description: 'No spaces inside range literals.'
680
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-space-inside-range-literals'
686
+ Style/IndentationConsistency:
687
+ Description: 'Keep indentation straight.'
681
688
  Enabled: false
682
689
 
683
- Style/SpaceInsideStringInterpolation:
684
- Description: 'Checks for padding/surrounding spaces inside string interpolation.'
685
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#string-interpolation'
690
+ Style/IndentationWidth:
691
+ Description: 'Use 2 spaces for indentation.'
692
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-indentation'
686
693
  Enabled: false
687
694
 
688
- Style/SpecialGlobalVars:
689
- Description: 'Avoid Perl-style global variables.'
690
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-cryptic-perlisms'
695
+ Style/IndentArray:
696
+ Description: >-
697
+ Checks the indentation of the first element in an array
698
+ literal.
691
699
  Enabled: false
692
700
 
693
- Style/StringLiterals:
694
- Description: 'Checks if uses of quotes match the configured preference.'
695
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#consistent-string-literals'
701
+ Style/IndentHash:
702
+ Description: 'Checks the indentation of the first key in a hash literal.'
696
703
  Enabled: false
697
704
 
698
- Style/StringLiteralsInInterpolation:
699
- Description: >-
700
- Checks if uses of quotes inside expressions in interpolated
701
- strings match the configured preference.
705
+ Style/InfiniteLoop:
706
+ Description: 'Use Kernel#loop for infinite loops.'
707
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#infinite-loop'
702
708
  Enabled: false
703
709
 
704
- Style/StructInheritance:
705
- Description: 'Checks for inheritance from Struct.new.'
706
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-extend-struct-new'
710
+ Style/Lambda:
711
+ Description: 'Use the new lambda literal syntax for single-line blocks.'
712
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#lambda-multi-line'
707
713
  Enabled: false
708
714
 
709
- Style/SymbolLiteral:
710
- Description: 'Use plain symbols instead of string symbols when possible.'
715
+ Style/LambdaCall:
716
+ Description: 'Use lambda.call(...) instead of lambda.(...).'
717
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#proc-call'
711
718
  Enabled: false
712
719
 
713
- Style/SymbolProc:
714
- Description: 'Use symbols as procs instead of blocks when possible.'
720
+ Style/LeadingCommentSpace:
721
+ Description: 'Comments should start with a space.'
722
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#hash-space'
715
723
  Enabled: false
716
724
 
717
- Style/Tab:
718
- Description: 'No hard tabs.'
719
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-indentation'
725
+ Style/LineEndConcatenation:
726
+ Description: >-
727
+ Use \ instead of + or << to concatenate two string literals at
728
+ line end.
720
729
  Enabled: false
721
730
 
722
- Style/TrailingBlankLines:
723
- Description: 'Checks trailing blank lines and final newline.'
724
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#newline-eof'
731
+ Style/MethodCallParentheses:
732
+ Description: 'Do not use parentheses for method calls with no arguments.'
733
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-args-no-parens'
725
734
  Enabled: false
726
735
 
727
- Style/TrailingComma:
728
- Description: 'Checks for trailing comma in parameter lists and literals.'
729
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
736
+ Style/MethodDefParentheses:
737
+ Description: >-
738
+ Checks if the method definitions have or don't have
739
+ parentheses.
740
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#method-parens'
730
741
  Enabled: false
731
742
 
732
- Style/TrailingWhitespace:
733
- Description: 'Avoid trailing whitespace.'
734
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-whitespace'
743
+ Style/MethodName:
744
+ Description: 'Use the configured style when naming methods.'
745
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#snake-case-symbols-methods-vars'
735
746
  Enabled: false
736
747
 
737
- Style/TrivialAccessors:
738
- Description: 'Prefer attr_* methods to trivial readers/writers.'
739
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#attr_family'
748
+ Style/ModuleFunction:
749
+ Description: 'Checks for usage of `extend self` in modules.'
750
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#module-function'
740
751
  Enabled: false
741
752
 
742
- Style/UnlessElse:
743
- Description: >-
744
- Do not use unless with else. Rewrite these with the positive
745
- case first.
746
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-else-with-unless'
753
+ Style/MultilineBlockChain:
754
+ Description: 'Avoid multi-line chains of blocks.'
755
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#single-line-blocks'
747
756
  Enabled: false
748
757
 
749
- Style/UnneededCapitalW:
750
- Description: 'Checks for %W when interpolation is not needed.'
758
+ Style/MultilineBlockLayout:
759
+ Description: 'Ensures newlines after multiline block do statements.'
751
760
  Enabled: false
752
761
 
753
- Style/UnneededPercentQ:
754
- Description: 'Checks for %q/%Q when single quotes or double quotes would do.'
755
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-q'
762
+ Style/MultilineIfThen:
763
+ Description: 'Do not use then for multi-line if/unless.'
764
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-then'
756
765
  Enabled: false
757
766
 
758
- Style/TrailingUnderscoreVariable:
767
+ Style/MultilineOperationIndentation:
759
768
  Description: >-
760
- Checks for the usage of unneeded trailing underscores at the
761
- end of parallel variable assignment.
769
+ Checks indentation of binary operations that span more than
770
+ one line.
762
771
  Enabled: false
763
772
 
764
- Style/VariableInterpolation:
773
+ Style/MultilineTernaryOperator:
765
774
  Description: >-
766
- Don't interpolate global, instance and class variables
767
- directly in strings.
768
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#curlies-interpolate'
775
+ Avoid multi-line ?: (the ternary operator);
776
+ use if/unless instead.
777
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-multiline-ternary'
769
778
  Enabled: false
770
779
 
771
- Style/VariableName:
772
- Description: 'Use the configured style when naming variables.'
773
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#snake-case-symbols-methods-vars'
780
+ Style/NegatedIf:
781
+ Description: >-
782
+ Favor unless over if for negative conditions
783
+ (or control flow or).
784
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#unless-for-negatives'
774
785
  Enabled: false
775
786
 
776
- Style/WhenThen:
777
- Description: 'Use when x then ... for one-line cases.'
778
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#one-line-cases'
787
+ Style/NegatedWhile:
788
+ Description: 'Favor until over while for negative conditions.'
789
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#until-for-negatives'
779
790
  Enabled: false
780
791
 
781
- Style/WhileUntilDo:
782
- Description: 'Checks for redundant do after while or until.'
783
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-multiline-while-do'
792
+ Style/NestedTernaryOperator:
793
+ Description: 'Use one expression per branch in a ternary operator.'
794
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-ternary'
784
795
  Enabled: false
785
796
 
786
- Style/WhileUntilModifier:
787
- Description: >-
788
- Favor modifier while/until usage when you have a
789
- single-line body.
790
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#while-as-a-modifier'
797
+ Style/Next:
798
+ Description: 'Use `next` to skip iteration instead of a condition at the end.'
799
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals'
791
800
  Enabled: false
792
801
 
793
- Style/WordArray:
794
- Description: 'Use %w or %W for arrays of words.'
795
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-w'
802
+ Style/NilComparison:
803
+ Description: 'Prefer x.nil? to x == nil.'
804
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#predicate-methods'
796
805
  Enabled: false
797
806
 
798
- ##########################################################
799
- Metrics/AbcSize:
800
- Description: >-
801
- A calculated magnitude based on number of assignments,
802
- branches, and conditions.
803
- Reference: 'http://c2.com/cgi/wiki?AbcMetric'
804
- Enabled: true
805
- Max: 20
806
-
807
- Metrics/BlockNesting:
808
- Description: 'Avoid excessive block nesting'
809
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#three-is-the-number-thou-shalt-count'
810
- Enabled: true
811
- Max: 4
812
-
813
- Metrics/ClassLength:
814
- Description: 'Avoid classes longer than 100 lines of code.'
815
- Enabled: true
816
- Max: 150
807
+ Style/NonNilCheck:
808
+ Description: 'Checks for redundant nil checks.'
809
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-non-nil-checks'
810
+ Enabled: false
817
811
 
818
- Metrics/ModuleLength:
819
- Description: 'Avoid modules longer than 100 lines of code.'
820
- Enabled: true
821
- Max: 150
812
+ Style/Not:
813
+ Description: 'Use ! instead of not.'
814
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#bang-not-not'
815
+ Enabled: false
822
816
 
823
- Metrics/CyclomaticComplexity:
817
+ Style/NumericLiterals:
824
818
  Description: >-
825
- A complexity metric that is strongly correlated to the number
826
- of test cases needed to validate a method.
819
+ Add underscores to large numeric literals to improve their
820
+ readability.
821
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#underscores-in-numerics'
827
822
  Enabled: false
828
823
 
829
- Metrics/LineLength:
830
- Description: 'Limit lines to 80 characters.'
831
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#80-character-limits'
824
+ Style/OneLineConditional:
825
+ Description: >-
826
+ Favor the ternary operator(?:) over
827
+ if/then/else/end constructs.
828
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#ternary-operator'
832
829
  Enabled: false
833
830
 
834
- Metrics/MethodLength:
835
- Description: 'Avoid methods longer than 10 lines of code.'
836
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#short-methods'
831
+ Style/OpMethod:
832
+ Description: 'When defining binary operators, name the argument other.'
833
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#other-arg'
837
834
  Enabled: false
838
835
 
839
- Metrics/ParameterLists:
840
- Description: 'Avoid parameter lists longer than three or four parameters.'
841
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#too-many-params'
842
- Enabled: true
843
-
844
- Metrics/PerceivedComplexity:
836
+ Style/OptionalArguments:
845
837
  Description: >-
846
- A complexity metric geared towards measuring complexity for a
847
- human reader.
838
+ Checks for optional arguments that do not appear at the end
839
+ of the argument list
840
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#optional-arguments'
848
841
  Enabled: false
849
842
 
850
- #################### Lint ################################
851
- ### Warnings
852
-
853
- Lint/AmbiguousOperator:
843
+ Style/ParallelAssignment:
854
844
  Description: >-
855
- Checks for ambiguous operators in the first argument of a
856
- method invocation without parentheses.
857
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#parens-as-args'
858
- Enabled: true
845
+ Check for simple usages of parallel assignment.
846
+ It will only warn when the number of variables
847
+ matches on both sides of the assignment.
848
+ This also provides performance benefits
849
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#parallel-assignment'
850
+ Reference: 'https://github.com/JuanitoFatas/fast-ruby#parallel-assignment-vs-sequential-assignment-code'
851
+ Enabled: false
859
852
 
860
- Lint/AmbiguousRegexpLiteral:
853
+ Style/ParenthesesAroundCondition:
861
854
  Description: >-
862
- Checks for ambiguous regexp literals in the first argument of
863
- a method invocation without parenthesis.
864
- Enabled: true
855
+ Don't use parentheses around the condition of an
856
+ if/unless/while.
857
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-parens-if'
858
+ Enabled: false
865
859
 
866
- Lint/AssignmentInCondition:
867
- Description: "Don't use assignment in conditions."
868
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#safe-assignment-in-condition'
869
- Enabled: true
860
+ Style/PercentLiteralDelimiters:
861
+ Description: 'Use `%`-literal delimiters consistently'
862
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-literal-braces'
863
+ Enabled: false
870
864
 
871
- Lint/BlockAlignment:
872
- Description: 'Align block ends correctly.'
873
- Enabled: true
865
+ Style/PercentQLiterals:
866
+ Description: 'Checks if uses of %Q/%q match the configured preference.'
867
+ Enabled: false
874
868
 
875
- Lint/CircularArgumentReference:
876
- Description: "Don't refer to the keyword argument in the default value."
877
- Enabled: true
869
+ Style/PerlBackrefs:
870
+ Description: 'Avoid Perl-style regex back references.'
871
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-perl-regexp-last-matchers'
872
+ Enabled: false
878
873
 
879
- Lint/ConditionPosition:
880
- Description: >-
881
- Checks for condition placed in a confusing position relative to
882
- the keyword.
883
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#same-line-condition'
884
- Enabled: true
874
+ Style/PredicateName:
875
+ Description: 'Check the names of predicate methods.'
876
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#bool-methods-qmark'
877
+ Enabled: false
885
878
 
886
- Lint/Debugger:
887
- Description: 'Check for debugger calls.'
888
- Enabled: true
879
+ Style/Proc:
880
+ Description: 'Use proc instead of Proc.new.'
881
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#proc'
882
+ Enabled: false
889
883
 
890
- Lint/DefEndAlignment:
891
- Description: 'Align ends corresponding to defs correctly.'
892
- Enabled: true
884
+ Style/RaiseArgs:
885
+ Description: 'Checks the arguments passed to raise/fail.'
886
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#exception-class-messages'
887
+ Enabled: false
893
888
 
894
- Lint/DeprecatedClassMethods:
895
- Description: 'Check for deprecated class method calls.'
896
- Enabled: true
889
+ Style/RedundantBegin:
890
+ Description: "Don't use begin blocks when they are not needed."
891
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#begin-implicit'
892
+ Enabled: false
897
893
 
898
- Lint/DuplicateMethods:
899
- Description: 'Check for duplicate methods calls.'
900
- Enabled: true
894
+ Style/RedundantException:
895
+ Description: "Checks for an obsolete RuntimeException argument in raise/fail."
896
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-explicit-runtimeerror'
897
+ Enabled: false
901
898
 
902
- Lint/EachWithObjectArgument:
903
- Description: 'Check for immutable argument given to each_with_object.'
904
- Enabled: true
899
+ Style/RedundantReturn:
900
+ Description: "Don't use return where it's not required."
901
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-explicit-return'
902
+ Enabled: false
905
903
 
906
- Lint/ElseLayout:
907
- Description: 'Check for odd code arrangement in an else block.'
908
- Enabled: true
904
+ Style/RedundantSelf:
905
+ Description: "Don't use self where it's not needed."
906
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-self-unless-required'
907
+ Enabled: false
909
908
 
910
- Lint/EmptyEnsure:
911
- Description: 'Checks for empty ensure block.'
912
- Enabled: true
909
+ Style/RegexpLiteral:
910
+ Description: 'Use / or %r around regular expressions.'
911
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-r'
912
+ Enabled: false
913
913
 
914
- Lint/EmptyInterpolation:
915
- Description: 'Checks for empty string interpolation.'
916
- Enabled: true
914
+ Style/RescueEnsureAlignment:
915
+ Description: 'Align rescues and ensures correctly.'
916
+ Enabled: false
917
917
 
918
- Lint/EndAlignment:
919
- Description: 'Align ends correctly.'
920
- Enabled: true
918
+ Style/RescueModifier:
919
+ Description: 'Avoid using rescue in its modifier form.'
920
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-rescue-modifiers'
921
+ Enabled: false
921
922
 
922
- Lint/EndInMethod:
923
- Description: 'END blocks should not be placed inside method definitions.'
924
- Enabled: true
923
+ Style/SelfAssignment:
924
+ Description: >-
925
+ Checks for places where self-assignment shorthand should have
926
+ been used.
927
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#self-assignment'
928
+ Enabled: false
925
929
 
926
- Lint/EnsureReturn:
927
- Description: 'Do not use return in an ensure block.'
928
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-return-ensure'
929
- Enabled: true
930
+ Style/Semicolon:
931
+ Description: "Don't use semicolons to terminate expressions."
932
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-semicolon'
933
+ Enabled: false
930
934
 
931
- Lint/Eval:
932
- Description: 'The use of eval represents a serious security risk.'
933
- Enabled: true
935
+ Style/SignalException:
936
+ Description: 'Checks for proper usage of fail and raise.'
937
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#fail-method'
938
+ Enabled: false
934
939
 
935
- Lint/FormatParameterMismatch:
936
- Description: 'The number of parameters to format/sprint must match the fields.'
937
- Enabled: true
940
+ Style/SingleLineBlockParams:
941
+ Description: 'Enforces the names of some block params.'
942
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#reduce-blocks'
943
+ Enabled: false
938
944
 
939
- Lint/HandleExceptions:
940
- Description: "Don't suppress exception."
941
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#dont-hide-exceptions'
942
- Enabled: true
945
+ Style/SingleLineMethods:
946
+ Description: 'Avoid single-line methods.'
947
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-single-line-methods'
948
+ Enabled: false
943
949
 
944
- Lint/InvalidCharacterLiteral:
950
+ Style/SingleSpaceBeforeFirstArg:
945
951
  Description: >-
946
- Checks for invalid character literals with a non-escaped
947
- whitespace character.
948
- Enabled: true
949
-
950
- Lint/LiteralInCondition:
951
- Description: 'Checks of literals used in conditions.'
952
- Enabled: true
953
-
954
- Lint/LiteralInInterpolation:
955
- Description: 'Checks for literals used in interpolation.'
956
- Enabled: true
952
+ Checks that exactly one space is used between a method name
953
+ and the first argument for method calls without parentheses.
954
+ Enabled: false
957
955
 
958
- Lint/Loop:
959
- Description: >-
960
- Use Kernel#loop with break rather than begin/end/until or
961
- begin/end/while for post-loop tests.
962
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#loop-with-break'
963
- Enabled: true
956
+ Style/SpaceAfterColon:
957
+ Description: 'Use spaces after colons.'
958
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-operators'
959
+ Enabled: false
964
960
 
965
- Lint/NestedMethodDefinition:
966
- Description: 'Do not use nested method definitions.'
967
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-methods'
968
- Enabled: true
961
+ Style/SpaceAfterComma:
962
+ Description: 'Use spaces after commas.'
963
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-operators'
964
+ Enabled: false
969
965
 
970
- Lint/NonLocalExitFromIterator:
971
- Description: 'Do not use return in iterator to cause non-local exit.'
972
- Enabled: true
966
+ Style/SpaceAfterControlKeyword:
967
+ Description: 'Use spaces after if/elsif/unless/while/until/case/when.'
968
+ Enabled: false
973
969
 
974
- Lint/ParenthesesAsGroupedExpression:
970
+ Style/SpaceAfterMethodName:
975
971
  Description: >-
976
- Checks for method calls with a space before the opening
977
- parenthesis.
972
+ Do not put a space between a method name and the opening
973
+ parenthesis in a method definition.
978
974
  StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#parens-no-spaces'
979
- Enabled: true
975
+ Enabled: false
980
976
 
981
- Lint/RequireParentheses:
977
+ Style/SpaceAfterNot:
978
+ Description: Tracks redundant space after the ! operator.
979
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-space-bang'
980
+ Enabled: false
981
+
982
+ Style/SpaceAfterSemicolon:
983
+ Description: 'Use spaces after semicolons.'
984
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-operators'
985
+ Enabled: false
986
+
987
+ Style/SpaceBeforeBlockBraces:
982
988
  Description: >-
983
- Use parentheses in the method call to avoid confusion
984
- about precedence.
985
- Enabled: true
989
+ Checks that the left block brace has or doesn't have space
990
+ before it.
991
+ Enabled: false
986
992
 
987
- Lint/RescueException:
988
- Description: 'Avoid rescuing the Exception class.'
989
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-blind-rescues'
990
- Enabled: true
993
+ Style/SpaceBeforeComma:
994
+ Description: 'No spaces before commas.'
995
+ Enabled: false
991
996
 
992
- Lint/ShadowingOuterLocalVariable:
997
+ Style/SpaceBeforeComment:
993
998
  Description: >-
994
- Do not use the same name as outer local variable
995
- for block arguments or block local variables.
996
- Enabled: true
999
+ Checks for missing space between code and a comment on the
1000
+ same line.
1001
+ Enabled: false
997
1002
 
998
- Lint/SpaceBeforeFirstArg:
999
- Description: >-
1000
- Put a space between a method name and the first argument
1001
- in a method call without parentheses.
1002
- Enabled: true
1003
+ Style/SpaceBeforeSemicolon:
1004
+ Description: 'No spaces before semicolons.'
1005
+ Enabled: false
1003
1006
 
1004
- Lint/StringConversionInInterpolation:
1005
- Description: 'Checks for Object#to_s usage in string interpolation.'
1006
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-to-s'
1007
- Enabled: true
1007
+ Style/SpaceInsideBlockBraces:
1008
+ Description: >-
1009
+ Checks that block braces have or don't have surrounding space.
1010
+ For blocks taking parameters, checks that the left brace has
1011
+ or doesn't have trailing space.
1012
+ Enabled: false
1008
1013
 
1009
- Lint/UnderscorePrefixedVariableName:
1010
- Description: 'Do not use prefix `_` for a variable that is used.'
1011
- Enabled: true
1014
+ Style/SpaceAroundBlockParameters:
1015
+ Description: 'Checks the spacing inside and after block parameters pipes.'
1016
+ Enabled: false
1012
1017
 
1013
- Lint/UnneededDisable:
1018
+ Style/SpaceAroundEqualsInParameterDefault:
1014
1019
  Description: >-
1015
- Checks for rubocop:disable comments that can be removed.
1016
- Note: this cop is not disabled when disabling all cops.
1017
- It must be explicitly disabled.
1018
- Enabled: true
1019
-
1020
- Lint/UnusedBlockArgument:
1021
- Description: 'Checks for unused block arguments.'
1022
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars'
1023
- Enabled: true
1020
+ Checks that the equals signs in parameter default assignments
1021
+ have or don't have surrounding space depending on
1022
+ configuration.
1023
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-around-equals'
1024
+ Enabled: false
1024
1025
 
1025
- Lint/UnusedMethodArgument:
1026
- Description: 'Checks for unused method arguments.'
1027
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars'
1028
- Enabled: true
1026
+ Style/SpaceAroundOperators:
1027
+ Description: 'Use a single space around operators.'
1028
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-operators'
1029
+ Enabled: false
1029
1030
 
1030
- Lint/UnreachableCode:
1031
- Description: 'Unreachable code.'
1032
- Enabled: true
1031
+ Style/SpaceBeforeModifierKeyword:
1032
+ Description: 'Put a space before the modifier keyword.'
1033
+ Enabled: false
1033
1034
 
1034
- Lint/UselessAccessModifier:
1035
- Description: 'Checks for useless access modifiers.'
1036
- Enabled: true
1035
+ Style/SpaceInsideBrackets:
1036
+ Description: 'No spaces after [ or before ].'
1037
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-spaces-braces'
1038
+ Enabled: false
1037
1039
 
1038
- Lint/UselessAssignment:
1039
- Description: 'Checks for useless assignment to a local variable.'
1040
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars'
1041
- Enabled: true
1040
+ Style/SpaceInsideHashLiteralBraces:
1041
+ Description: "Use spaces inside hash literal braces - or don't."
1042
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-operators'
1043
+ Enabled: false
1042
1044
 
1043
- Lint/UselessComparison:
1044
- Description: 'Checks for comparison of something with itself.'
1045
- Enabled: true
1045
+ Style/SpaceInsideParens:
1046
+ Description: 'No spaces after ( or before ).'
1047
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-spaces-braces'
1048
+ Enabled: false
1046
1049
 
1047
- Lint/UselessElseWithoutRescue:
1048
- Description: 'Checks for useless `else` in `begin..end` without `rescue`.'
1049
- Enabled: true
1050
+ Style/SpaceInsideRangeLiteral:
1051
+ Description: 'No spaces inside range literals.'
1052
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-space-inside-range-literals'
1053
+ Enabled: false
1050
1054
 
1051
- Lint/UselessSetterCall:
1052
- Description: 'Checks for useless setter call to a local variable.'
1053
- Enabled: true
1055
+ Style/SpaceInsideStringInterpolation:
1056
+ Description: 'Checks for padding/surrounding spaces inside string interpolation.'
1057
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#string-interpolation'
1058
+ Enabled: false
1054
1059
 
1055
- Lint/Void:
1056
- Description: 'Possible use of operator/literal/variable in void context.'
1057
- Enabled: true
1060
+ Style/SpecialGlobalVars:
1061
+ Description: 'Avoid Perl-style global variables.'
1062
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-cryptic-perlisms'
1063
+ Enabled: false
1058
1064
 
1059
- ##################### Performance #############################
1065
+ Style/StringLiterals:
1066
+ Description: 'Checks if uses of quotes match the configured preference.'
1067
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#consistent-string-literals'
1068
+ Enabled: false
1060
1069
 
1061
- Performance/Count:
1070
+ Style/StringLiteralsInInterpolation:
1062
1071
  Description: >-
1063
- Use `count` instead of `select...size`, `reject...size`,
1064
- `select...count`, `reject...count`, `select...length`,
1065
- and `reject...length`.
1066
- Enabled: true
1072
+ Checks if uses of quotes inside expressions in interpolated
1073
+ strings match the configured preference.
1074
+ Enabled: false
1067
1075
 
1068
- Performance/Detect:
1069
- Description: >-
1070
- Use `detect` instead of `select.first`, `find_all.first`,
1071
- `select.last`, and `find_all.last`.
1072
- Reference: 'https://github.com/JuanitoFatas/fast-ruby#enumerabledetect-vs-enumerableselectfirst-code'
1073
- Enabled: true
1076
+ Style/StructInheritance:
1077
+ Description: 'Checks for inheritance from Struct.new.'
1078
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-extend-struct-new'
1079
+ Enabled: false
1074
1080
 
1075
- Performance/FlatMap:
1076
- Description: >-
1077
- Use `Enumerable#flat_map`
1078
- instead of `Enumerable#map...Array#flatten(1)`
1079
- or `Enumberable#collect..Array#flatten(1)`
1080
- Reference: 'https://github.com/JuanitoFatas/fast-ruby#enumerablemaparrayflatten-vs-enumerableflat_map-code'
1081
- Enabled: true
1082
- EnabledForFlattenWithoutParams: false
1083
- # If enabled, this cop will warn about usages of
1084
- # `flatten` being called without any parameters.
1085
- # This can be dangerous since `flat_map` will only flatten 1 level, and
1086
- # `flatten` without any parameters can flatten multiple levels.
1081
+ Style/SymbolLiteral:
1082
+ Description: 'Use plain symbols instead of string symbols when possible.'
1083
+ Enabled: false
1087
1084
 
1088
- Performance/ReverseEach:
1089
- Description: 'Use `reverse_each` instead of `reverse.each`.'
1090
- Reference: 'https://github.com/JuanitoFatas/fast-ruby#enumerablereverseeach-vs-enumerablereverse_each-code'
1091
- Enabled: true
1085
+ Style/SymbolProc:
1086
+ Description: 'Use symbols as procs instead of blocks when possible.'
1087
+ Enabled: false
1092
1088
 
1093
- Performance/Sample:
1094
- Description: >-
1095
- Use `sample` instead of `shuffle.first`,
1096
- `shuffle.last`, and `shuffle[Fixnum]`.
1097
- Reference: 'https://github.com/JuanitoFatas/fast-ruby#arrayshufflefirst-vs-arraysample-code'
1098
- Enabled: true
1089
+ Style/Tab:
1090
+ Description: 'No hard tabs.'
1091
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-indentation'
1092
+ Enabled: false
1099
1093
 
1100
- Performance/Size:
1101
- Description: >-
1102
- Use `size` instead of `count` for counting
1103
- the number of elements in `Array` and `Hash`.
1104
- Reference: 'https://github.com/JuanitoFatas/fast-ruby#arraycount-vs-arraysize-code'
1105
- Enabled: true
1094
+ Style/TrailingBlankLines:
1095
+ Description: 'Checks trailing blank lines and final newline.'
1096
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#newline-eof'
1097
+ Enabled: false
1106
1098
 
1107
- Performance/StringReplacement:
1108
- Description: >-
1109
- Use `tr` instead of `gsub` when you are replacing the same
1110
- number of characters. Use `delete` instead of `gsub` when
1111
- you are deleting characters.
1112
- Reference: 'https://github.com/JuanitoFatas/fast-ruby#stringgsub-vs-stringtr-code'
1113
- Enabled: true
1099
+ Style/TrailingComma:
1100
+ Description: 'Checks for trailing comma in parameter lists and literals.'
1101
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
1102
+ Enabled: false
1114
1103
 
1115
- ##################### Rails ##################################
1116
- #
1117
- # Consider enabling some/all of these if you use Rails.
1118
- #
1119
- Rails/ActionFilter:
1120
- Description: 'Enforces consistent use of action filter methods.'
1104
+ Style/TrailingWhitespace:
1105
+ Description: 'Avoid trailing whitespace.'
1106
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-whitespace'
1121
1107
  Enabled: false
1122
1108
 
1123
- Rails/Date:
1124
- Description: >-
1125
- Checks the correct usage of date aware methods,
1126
- such as Date.today, Date.current etc.
1109
+ Style/TrivialAccessors:
1110
+ Description: 'Prefer attr_* methods to trivial readers/writers.'
1111
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#attr_family'
1127
1112
  Enabled: false
1128
1113
 
1129
- Rails/DefaultScope:
1130
- Description: 'Checks if the argument passed to default_scope is a block.'
1114
+ Style/UnlessElse:
1115
+ Description: >-
1116
+ Do not use unless with else. Rewrite these with the positive
1117
+ case first.
1118
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-else-with-unless'
1131
1119
  Enabled: false
1132
1120
 
1133
- Rails/Delegate:
1134
- Description: 'Prefer delegate method for delegations.'
1121
+ Style/UnneededCapitalW:
1122
+ Description: 'Checks for %W when interpolation is not needed.'
1135
1123
  Enabled: false
1136
1124
 
1137
- Rails/FindBy:
1138
- Description: 'Prefer find_by over where.first.'
1125
+ Style/UnneededPercentQ:
1126
+ Description: 'Checks for %q/%Q when single quotes or double quotes would do.'
1127
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-q'
1139
1128
  Enabled: false
1140
1129
 
1141
- Rails/FindEach:
1142
- Description: 'Prefer all.find_each over all.find.'
1130
+ Style/TrailingUnderscoreVariable:
1131
+ Description: >-
1132
+ Checks for the usage of unneeded trailing underscores at the
1133
+ end of parallel variable assignment.
1143
1134
  Enabled: false
1144
1135
 
1145
- Rails/HasAndBelongsToMany:
1146
- Description: 'Prefer has_many :through to has_and_belongs_to_many.'
1136
+ Style/VariableInterpolation:
1137
+ Description: >-
1138
+ Don't interpolate global, instance and class variables
1139
+ directly in strings.
1140
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#curlies-interpolate'
1147
1141
  Enabled: false
1148
1142
 
1149
- Rails/Output:
1150
- Description: 'Checks for calls to puts, print, etc.'
1143
+ Style/VariableName:
1144
+ Description: 'Use the configured style when naming variables.'
1145
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#snake-case-symbols-methods-vars'
1151
1146
  Enabled: false
1152
1147
 
1153
- Rails/ReadWriteAttribute:
1154
- Description: >-
1155
- Checks for read_attribute(:attr) and
1156
- write_attribute(:attr, val).
1148
+ Style/WhenThen:
1149
+ Description: 'Use when x then ... for one-line cases.'
1150
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#one-line-cases'
1157
1151
  Enabled: false
1158
1152
 
1159
- Rails/ScopeArgs:
1160
- Description: 'Checks the arguments of ActiveRecord scopes.'
1153
+ Style/WhileUntilDo:
1154
+ Description: 'Checks for redundant do after while or until.'
1155
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-multiline-while-do'
1161
1156
  Enabled: false
1162
1157
 
1163
- Rails/TimeZone:
1164
- Description: 'Checks the correct usage of time zone aware methods.'
1165
- StyleGuide: 'https://github.com/bbatsov/rails-style-guide#time'
1166
- Reference: 'http://danilenko.org/2012/7/6/rails_timezones'
1158
+ Style/WhileUntilModifier:
1159
+ Description: >-
1160
+ Favor modifier while/until usage when you have a
1161
+ single-line body.
1162
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#while-as-a-modifier'
1167
1163
  Enabled: false
1168
1164
 
1169
- Rails/Validation:
1170
- Description: 'Use validates :attribute, hash of validations.'
1165
+ Style/WordArray:
1166
+ Description: 'Use %w or %W for arrays of words.'
1167
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-w'
1171
1168
  Enabled: false