stylecheck 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/config/stylecheck/rubocop.yml +1614 -0
- data/config/stylecheck/scss-lint.yml +0 -0
- data/lib/rake_tasks.rb +2 -0
- data/lib/stylecheck/railtie.rb +12 -0
- data/lib/stylecheck/version.rb +1 -1
- data/lib/stylecheck.rb +1 -2
- data/lib/tasks/stylecheck.rake +39 -0
- metadata +35 -26
- data/.gitignore +0 -10
- data/.rspec +0 -2
- data/.travis.yml +0 -5
- data/Gemfile +0 -4
- data/LICENSE.txt +0 -21
- data/README.md +0 -41
- data/Rakefile +0 -6
- data/bin/console +0 -14
- data/bin/setup +0 -8
- data/stylecheck.gemspec +0 -36
@@ -0,0 +1,1614 @@
|
|
1
|
+
# These are all the cops that are enabled in the default configuration.
|
2
|
+
|
3
|
+
Style/AccessModifierIndentation:
|
4
|
+
Description: Check indentation of private/protected visibility modifiers.
|
5
|
+
StyleGuide: '#indent-public-private-protected'
|
6
|
+
Enabled: true
|
7
|
+
|
8
|
+
Style/AccessorMethodName:
|
9
|
+
Description: Check the naming of accessor methods for get_/set_.
|
10
|
+
StyleGuide: '#accessor_mutator_method_names'
|
11
|
+
Enabled: true
|
12
|
+
|
13
|
+
Style/Alias:
|
14
|
+
Description: 'Use alias instead of alias_method.'
|
15
|
+
StyleGuide: '#alias-method'
|
16
|
+
Enabled: true
|
17
|
+
|
18
|
+
Style/AlignArray:
|
19
|
+
Description: >-
|
20
|
+
Align the elements of an array literal if they span more than
|
21
|
+
one line.
|
22
|
+
StyleGuide: '#align-multiline-arrays'
|
23
|
+
Enabled: true
|
24
|
+
|
25
|
+
Style/AlignHash:
|
26
|
+
Description: >-
|
27
|
+
Align the elements of a hash literal if they span more than
|
28
|
+
one line.
|
29
|
+
Enabled: true
|
30
|
+
|
31
|
+
Style/AlignParameters:
|
32
|
+
Description: >-
|
33
|
+
Align the parameters of a method call if they span more
|
34
|
+
than one line.
|
35
|
+
StyleGuide: '#no-double-indent'
|
36
|
+
Enabled: true
|
37
|
+
|
38
|
+
Style/AndOr:
|
39
|
+
Description: 'Use &&/|| instead of and/or.'
|
40
|
+
StyleGuide: '#no-and-or-or'
|
41
|
+
Enabled: true
|
42
|
+
|
43
|
+
Style/ArrayJoin:
|
44
|
+
Description: 'Use Array#join instead of Array#*.'
|
45
|
+
StyleGuide: '#array-join'
|
46
|
+
Enabled: true
|
47
|
+
|
48
|
+
Style/AsciiComments:
|
49
|
+
Description: 'Use only ascii symbols in comments.'
|
50
|
+
StyleGuide: '#english-comments'
|
51
|
+
Enabled: true
|
52
|
+
|
53
|
+
Style/AsciiIdentifiers:
|
54
|
+
Description: 'Use only ascii symbols in identifiers.'
|
55
|
+
StyleGuide: '#english-identifiers'
|
56
|
+
Enabled: true
|
57
|
+
|
58
|
+
Style/Attr:
|
59
|
+
Description: 'Checks for uses of Module#attr.'
|
60
|
+
StyleGuide: '#attr'
|
61
|
+
Enabled: true
|
62
|
+
|
63
|
+
Style/BeginBlock:
|
64
|
+
Description: 'Avoid the use of BEGIN blocks.'
|
65
|
+
StyleGuide: '#no-BEGIN-blocks'
|
66
|
+
Enabled: true
|
67
|
+
|
68
|
+
Style/BarePercentLiterals:
|
69
|
+
Description: 'Checks if usage of %() or %Q() matches configuration.'
|
70
|
+
StyleGuide: '#percent-q-shorthand'
|
71
|
+
Enabled: true
|
72
|
+
|
73
|
+
Style/BlockComments:
|
74
|
+
Description: 'Do not use block comments.'
|
75
|
+
StyleGuide: '#no-block-comments'
|
76
|
+
Enabled: true
|
77
|
+
|
78
|
+
Style/BlockEndNewline:
|
79
|
+
Description: 'Put end statement of multiline block on its own line.'
|
80
|
+
Enabled: true
|
81
|
+
|
82
|
+
Style/BlockDelimiters:
|
83
|
+
Description: >-
|
84
|
+
Avoid using {...} for multi-line blocks (multiline chaining is
|
85
|
+
always ugly).
|
86
|
+
Prefer {...} over do...end for single-line blocks.
|
87
|
+
StyleGuide: '#single-line-blocks'
|
88
|
+
Enabled: true
|
89
|
+
|
90
|
+
Style/BracesAroundHashParameters:
|
91
|
+
Description: 'Enforce braces style around hash parameters.'
|
92
|
+
Enabled: true
|
93
|
+
|
94
|
+
Style/CaseEquality:
|
95
|
+
Description: 'Avoid explicit use of the case equality operator(===).'
|
96
|
+
StyleGuide: '#no-case-equality'
|
97
|
+
Enabled: true
|
98
|
+
|
99
|
+
Style/CaseIndentation:
|
100
|
+
Description: 'Indentation of when in a case/when/[else/]end.'
|
101
|
+
StyleGuide: '#indent-when-to-case'
|
102
|
+
Enabled: true
|
103
|
+
|
104
|
+
Style/CharacterLiteral:
|
105
|
+
Description: 'Checks for uses of character literals.'
|
106
|
+
StyleGuide: '#no-character-literals'
|
107
|
+
Enabled: true
|
108
|
+
|
109
|
+
Style/ClassAndModuleCamelCase:
|
110
|
+
Description: 'Use CamelCase for classes and modules.'
|
111
|
+
StyleGuide: '#camelcase-classes'
|
112
|
+
Enabled: true
|
113
|
+
|
114
|
+
Style/ClassAndModuleChildren:
|
115
|
+
Description: 'Checks style of children classes and modules.'
|
116
|
+
Enabled: true
|
117
|
+
|
118
|
+
Style/ClassCheck:
|
119
|
+
Description: 'Enforces consistent use of `Object#is_a?` or `Object#kind_of?`.'
|
120
|
+
Enabled: true
|
121
|
+
|
122
|
+
Style/ClassMethods:
|
123
|
+
Description: 'Use self when defining module/class methods.'
|
124
|
+
StyleGuide: '#def-self-class-methods'
|
125
|
+
Enabled: true
|
126
|
+
|
127
|
+
Style/ClassVars:
|
128
|
+
Description: 'Avoid the use of class variables.'
|
129
|
+
StyleGuide: '#no-class-vars'
|
130
|
+
Enabled: true
|
131
|
+
|
132
|
+
Style/ClosingParenthesisIndentation:
|
133
|
+
Description: 'Checks the indentation of hanging closing parentheses.'
|
134
|
+
Enabled: true
|
135
|
+
|
136
|
+
Style/ColonMethodCall:
|
137
|
+
Description: 'Do not use :: for method call.'
|
138
|
+
StyleGuide: '#double-colons'
|
139
|
+
Enabled: true
|
140
|
+
|
141
|
+
Style/CommandLiteral:
|
142
|
+
Description: 'Use `` or %x around command literals.'
|
143
|
+
StyleGuide: '#percent-x'
|
144
|
+
Enabled: true
|
145
|
+
|
146
|
+
Style/CommentAnnotation:
|
147
|
+
Description: >-
|
148
|
+
Checks formatting of special comments
|
149
|
+
(TODO, FIXME, OPTIMIZE, HACK, REVIEW).
|
150
|
+
StyleGuide: '#annotate-keywords'
|
151
|
+
Enabled: true
|
152
|
+
|
153
|
+
Style/CommentIndentation:
|
154
|
+
Description: 'Indentation of comments.'
|
155
|
+
Enabled: true
|
156
|
+
|
157
|
+
Style/ConditionalAssignment:
|
158
|
+
Description: >-
|
159
|
+
Use the return value of `if` and `case` statements for
|
160
|
+
assignment to a variable and variable comparison instead
|
161
|
+
of assigning that variable inside of each branch.
|
162
|
+
Enabled: true
|
163
|
+
|
164
|
+
Style/ConstantName:
|
165
|
+
Description: 'Constants should use SCREAMING_SNAKE_CASE.'
|
166
|
+
StyleGuide: '#screaming-snake-case'
|
167
|
+
Enabled: true
|
168
|
+
|
169
|
+
Style/DefWithParentheses:
|
170
|
+
Description: 'Use def with parentheses when there are arguments.'
|
171
|
+
StyleGuide: '#method-parens'
|
172
|
+
Enabled: true
|
173
|
+
|
174
|
+
Style/Documentation:
|
175
|
+
Description: 'Document classes and non-namespace modules.'
|
176
|
+
Enabled: true
|
177
|
+
Exclude:
|
178
|
+
- 'spec/**/*'
|
179
|
+
- 'test/**/*'
|
180
|
+
|
181
|
+
Style/DotPosition:
|
182
|
+
Description: 'Checks the position of the dot in multi-line method calls.'
|
183
|
+
StyleGuide: '#consistent-multi-line-chains'
|
184
|
+
Enabled: true
|
185
|
+
|
186
|
+
Style/DoubleNegation:
|
187
|
+
Description: 'Checks for uses of double negation (!!).'
|
188
|
+
StyleGuide: '#no-bang-bang'
|
189
|
+
Enabled: true
|
190
|
+
|
191
|
+
Style/EachForSimpleLoop:
|
192
|
+
Description: >-
|
193
|
+
Use `Integer#times` for a simple loop which iterates a fixed
|
194
|
+
number of times.
|
195
|
+
Enabled: true
|
196
|
+
|
197
|
+
Style/EachWithObject:
|
198
|
+
Description: 'Prefer `each_with_object` over `inject` or `reduce`.'
|
199
|
+
Enabled: true
|
200
|
+
|
201
|
+
Style/ElseAlignment:
|
202
|
+
Description: 'Align elses and elsifs correctly.'
|
203
|
+
Enabled: true
|
204
|
+
|
205
|
+
Style/EmptyElse:
|
206
|
+
Description: 'Avoid empty else-clauses.'
|
207
|
+
Enabled: true
|
208
|
+
|
209
|
+
Style/EmptyCaseCondition:
|
210
|
+
Description: 'Avoid empty condition in case statements.'
|
211
|
+
Enabled: true
|
212
|
+
|
213
|
+
Style/EmptyLineBetweenDefs:
|
214
|
+
Description: 'Use empty lines between defs.'
|
215
|
+
StyleGuide: '#empty-lines-between-methods'
|
216
|
+
Enabled: true
|
217
|
+
|
218
|
+
Style/EmptyLines:
|
219
|
+
Description: "Don't use several empty lines in a row."
|
220
|
+
Enabled: true
|
221
|
+
|
222
|
+
Style/EmptyLinesAroundAccessModifier:
|
223
|
+
Description: "Keep blank lines around access modifiers."
|
224
|
+
Enabled: true
|
225
|
+
|
226
|
+
Style/EmptyLinesAroundBlockBody:
|
227
|
+
Description: "Keeps track of empty lines around block bodies."
|
228
|
+
Enabled: true
|
229
|
+
|
230
|
+
Style/EmptyLinesAroundClassBody:
|
231
|
+
Description: "Keeps track of empty lines around class bodies."
|
232
|
+
Enabled: true
|
233
|
+
|
234
|
+
Style/EmptyLinesAroundModuleBody:
|
235
|
+
Description: "Keeps track of empty lines around module bodies."
|
236
|
+
Enabled: true
|
237
|
+
|
238
|
+
Style/EmptyLinesAroundMethodBody:
|
239
|
+
Description: "Keeps track of empty lines around method bodies."
|
240
|
+
Enabled: true
|
241
|
+
|
242
|
+
Style/EmptyLiteral:
|
243
|
+
Description: 'Prefer literals to Array.new/Hash.new/String.new.'
|
244
|
+
StyleGuide: '#literal-array-hash'
|
245
|
+
Enabled: true
|
246
|
+
|
247
|
+
Style/EmptyMethod:
|
248
|
+
Description: 'Checks the formatting of empty method definitions.'
|
249
|
+
StyleGuide: '#no-single-line-methods'
|
250
|
+
Enabled: true
|
251
|
+
|
252
|
+
Style/EndBlock:
|
253
|
+
Description: 'Avoid the use of END blocks.'
|
254
|
+
StyleGuide: '#no-END-blocks'
|
255
|
+
Enabled: true
|
256
|
+
|
257
|
+
Style/EndOfLine:
|
258
|
+
Description: 'Use Unix-style line endings.'
|
259
|
+
StyleGuide: '#crlf'
|
260
|
+
Enabled: true
|
261
|
+
|
262
|
+
Style/EvenOdd:
|
263
|
+
Description: 'Favor the use of Integer#even? && Integer#odd?'
|
264
|
+
StyleGuide: '#predicate-methods'
|
265
|
+
Enabled: true
|
266
|
+
|
267
|
+
Style/ExtraSpacing:
|
268
|
+
Description: 'Do not use unnecessary spacing.'
|
269
|
+
Enabled: true
|
270
|
+
|
271
|
+
Style/FileName:
|
272
|
+
Description: 'Use snake_case for source file names.'
|
273
|
+
StyleGuide: '#snake-case-files'
|
274
|
+
Enabled: true
|
275
|
+
|
276
|
+
Style/FrozenStringLiteralComment:
|
277
|
+
Description: >-
|
278
|
+
Add the frozen_string_literal comment to the top of files
|
279
|
+
to help transition from Ruby 2.3.0 to Ruby 3.0.
|
280
|
+
Enabled: true
|
281
|
+
|
282
|
+
Style/InitialIndentation:
|
283
|
+
Description: >-
|
284
|
+
Checks the indentation of the first non-blank non-comment line in a file.
|
285
|
+
Enabled: true
|
286
|
+
|
287
|
+
Style/FirstParameterIndentation:
|
288
|
+
Description: 'Checks the indentation of the first parameter in a method call.'
|
289
|
+
Enabled: true
|
290
|
+
|
291
|
+
Style/FlipFlop:
|
292
|
+
Description: 'Checks for flip flops'
|
293
|
+
StyleGuide: '#no-flip-flops'
|
294
|
+
Enabled: true
|
295
|
+
|
296
|
+
Style/For:
|
297
|
+
Description: 'Checks use of for or each in multiline loops.'
|
298
|
+
StyleGuide: '#no-for-loops'
|
299
|
+
Enabled: true
|
300
|
+
|
301
|
+
Style/FormatString:
|
302
|
+
Description: 'Enforce the use of Kernel#sprintf, Kernel#format or String#%.'
|
303
|
+
StyleGuide: '#sprintf'
|
304
|
+
Enabled: true
|
305
|
+
|
306
|
+
Style/GlobalVars:
|
307
|
+
Description: 'Do not introduce global variables.'
|
308
|
+
StyleGuide: '#instance-vars'
|
309
|
+
Reference: 'http://www.zenspider.com/Languages/Ruby/QuickRef.html'
|
310
|
+
Enabled: true
|
311
|
+
|
312
|
+
Style/GuardClause:
|
313
|
+
Description: 'Check for conditionals that can be replaced with guard clauses'
|
314
|
+
StyleGuide: '#no-nested-conditionals'
|
315
|
+
Enabled: true
|
316
|
+
|
317
|
+
Style/HashSyntax:
|
318
|
+
Description: >-
|
319
|
+
Prefer Ruby 1.9 hash syntax { a: 1, b: 2 } over 1.8 syntax
|
320
|
+
{ :a => 1, :b => 2 }.
|
321
|
+
StyleGuide: '#hash-literals'
|
322
|
+
Enabled: true
|
323
|
+
|
324
|
+
Style/IfInsideElse:
|
325
|
+
Description: 'Finds if nodes inside else, which can be converted to elsif.'
|
326
|
+
Enabled: true
|
327
|
+
|
328
|
+
Style/IfUnlessModifier:
|
329
|
+
Description: >-
|
330
|
+
Favor modifier if/unless usage when you have a
|
331
|
+
single-line body.
|
332
|
+
StyleGuide: '#if-as-a-modifier'
|
333
|
+
Enabled: true
|
334
|
+
|
335
|
+
Style/IfUnlessModifierOfIfUnless:
|
336
|
+
Description: >-
|
337
|
+
Avoid modifier if/unless usage on conditionals.
|
338
|
+
Enabled: true
|
339
|
+
|
340
|
+
Style/IfWithSemicolon:
|
341
|
+
Description: 'Do not use if x; .... Use the ternary operator instead.'
|
342
|
+
StyleGuide: '#no-semicolon-ifs'
|
343
|
+
Enabled: true
|
344
|
+
|
345
|
+
Style/IndentationConsistency:
|
346
|
+
Description: 'Keep indentation straight.'
|
347
|
+
Enabled: true
|
348
|
+
|
349
|
+
Style/IndentationWidth:
|
350
|
+
Description: 'Use 2 spaces for indentation.'
|
351
|
+
StyleGuide: '#spaces-indentation'
|
352
|
+
Enabled: true
|
353
|
+
|
354
|
+
Style/IdenticalConditionalBranches:
|
355
|
+
Description: >-
|
356
|
+
Checks that conditional statements do not have an identical
|
357
|
+
line at the end of each branch, which can validly be moved
|
358
|
+
out of the conditional.
|
359
|
+
Enabled: true
|
360
|
+
|
361
|
+
Style/IndentArray:
|
362
|
+
Description: >-
|
363
|
+
Checks the indentation of the first element in an array
|
364
|
+
literal.
|
365
|
+
Enabled: true
|
366
|
+
|
367
|
+
Style/IndentAssignment:
|
368
|
+
Description: >-
|
369
|
+
Checks the indentation of the first line of the
|
370
|
+
right-hand-side of a multi-line assignment.
|
371
|
+
Enabled: true
|
372
|
+
|
373
|
+
Style/IndentHash:
|
374
|
+
Description: 'Checks the indentation of the first key in a hash literal.'
|
375
|
+
Enabled: true
|
376
|
+
|
377
|
+
Style/InfiniteLoop:
|
378
|
+
Description: 'Use Kernel#loop for infinite loops.'
|
379
|
+
StyleGuide: '#infinite-loop'
|
380
|
+
Enabled: true
|
381
|
+
|
382
|
+
Style/Lambda:
|
383
|
+
Description: 'Use the new lambda literal syntax for single-line blocks.'
|
384
|
+
StyleGuide: '#lambda-multi-line'
|
385
|
+
Enabled: true
|
386
|
+
|
387
|
+
Style/SpaceInLambdaLiteral:
|
388
|
+
Description: 'Checks for spaces in lambda literals.'
|
389
|
+
Enabled: true
|
390
|
+
|
391
|
+
Style/LambdaCall:
|
392
|
+
Description: 'Use lambda.call(...) instead of lambda.(...).'
|
393
|
+
StyleGuide: '#proc-call'
|
394
|
+
Enabled: true
|
395
|
+
|
396
|
+
Style/LeadingCommentSpace:
|
397
|
+
Description: 'Comments should start with a space.'
|
398
|
+
StyleGuide: '#hash-space'
|
399
|
+
Enabled: true
|
400
|
+
|
401
|
+
Style/LineEndConcatenation:
|
402
|
+
Description: >-
|
403
|
+
Use \ instead of + or << to concatenate two string literals at
|
404
|
+
line end.
|
405
|
+
Enabled: true
|
406
|
+
|
407
|
+
Style/MethodCallParentheses:
|
408
|
+
Description: 'Do not use parentheses for method calls with no arguments.'
|
409
|
+
StyleGuide: '#method-invocation-parens'
|
410
|
+
Enabled: true
|
411
|
+
|
412
|
+
Style/MethodDefParentheses:
|
413
|
+
Description: >-
|
414
|
+
Checks if the method definitions have or don't have
|
415
|
+
parentheses.
|
416
|
+
StyleGuide: '#method-parens'
|
417
|
+
Enabled: true
|
418
|
+
|
419
|
+
Style/MethodName:
|
420
|
+
Description: 'Use the configured style when naming methods.'
|
421
|
+
StyleGuide: '#snake-case-symbols-methods-vars'
|
422
|
+
Enabled: true
|
423
|
+
|
424
|
+
Style/MethodMissing:
|
425
|
+
Description: 'Avoid using `method_missing`.'
|
426
|
+
StyleGuide: '#no-method-missing'
|
427
|
+
Enabled: true
|
428
|
+
|
429
|
+
Style/ModuleFunction:
|
430
|
+
Description: 'Checks for usage of `extend self` in modules.'
|
431
|
+
StyleGuide: '#module-function'
|
432
|
+
Enabled: true
|
433
|
+
|
434
|
+
Style/MultilineArrayBraceLayout:
|
435
|
+
Description: >-
|
436
|
+
Checks that the closing brace in an array literal is
|
437
|
+
either on the same line as the last array element, or
|
438
|
+
a new line.
|
439
|
+
Enabled: true
|
440
|
+
|
441
|
+
Style/MultilineBlockChain:
|
442
|
+
Description: 'Avoid multi-line chains of blocks.'
|
443
|
+
StyleGuide: '#single-line-blocks'
|
444
|
+
Enabled: true
|
445
|
+
|
446
|
+
Style/MultilineBlockLayout:
|
447
|
+
Description: 'Ensures newlines after multiline block do statements.'
|
448
|
+
Enabled: true
|
449
|
+
|
450
|
+
Style/MultilineHashBraceLayout:
|
451
|
+
Description: >-
|
452
|
+
Checks that the closing brace in a hash literal is
|
453
|
+
either on the same line as the last hash element, or
|
454
|
+
a new line.
|
455
|
+
Enabled: true
|
456
|
+
|
457
|
+
Style/MultilineIfThen:
|
458
|
+
Description: 'Do not use then for multi-line if/unless.'
|
459
|
+
StyleGuide: '#no-then'
|
460
|
+
Enabled: true
|
461
|
+
|
462
|
+
Style/MultilineIfModifier:
|
463
|
+
Description: 'Only use if/unless modifiers on single line statements.'
|
464
|
+
StyleGuide: '#no-multiline-if-modifiers'
|
465
|
+
Enabled: true
|
466
|
+
|
467
|
+
Style/MultilineMemoization:
|
468
|
+
Description: 'Wrap multiline memoizations in a `begin` and `end` block.'
|
469
|
+
Enabled: true
|
470
|
+
|
471
|
+
Style/MultilineMethodCallBraceLayout:
|
472
|
+
Description: >-
|
473
|
+
Checks that the closing brace in a method call is
|
474
|
+
either on the same line as the last method argument, or
|
475
|
+
a new line.
|
476
|
+
Enabled: true
|
477
|
+
|
478
|
+
Style/MultilineMethodCallIndentation:
|
479
|
+
Description: >-
|
480
|
+
Checks indentation of method calls with the dot operator
|
481
|
+
that span more than one line.
|
482
|
+
Enabled: true
|
483
|
+
|
484
|
+
Style/MultilineMethodDefinitionBraceLayout:
|
485
|
+
Description: >-
|
486
|
+
Checks that the closing brace in a method definition is
|
487
|
+
either on the same line as the last method parameter, or
|
488
|
+
a new line.
|
489
|
+
Enabled: true
|
490
|
+
|
491
|
+
Style/MultilineOperationIndentation:
|
492
|
+
Description: >-
|
493
|
+
Checks indentation of binary operations that span more than
|
494
|
+
one line.
|
495
|
+
Enabled: true
|
496
|
+
|
497
|
+
Style/MultilineTernaryOperator:
|
498
|
+
Description: >-
|
499
|
+
Avoid multi-line ?: (the ternary operator);
|
500
|
+
use if/unless instead.
|
501
|
+
StyleGuide: '#no-multiline-ternary'
|
502
|
+
Enabled: true
|
503
|
+
|
504
|
+
Style/MutableConstant:
|
505
|
+
Description: 'Do not assign mutable objects to constants.'
|
506
|
+
Enabled: true
|
507
|
+
|
508
|
+
Style/NegatedIf:
|
509
|
+
Description: >-
|
510
|
+
Favor unless over if for negative conditions
|
511
|
+
(or control flow or).
|
512
|
+
StyleGuide: '#unless-for-negatives'
|
513
|
+
Enabled: true
|
514
|
+
|
515
|
+
Style/NegatedWhile:
|
516
|
+
Description: 'Favor until over while for negative conditions.'
|
517
|
+
StyleGuide: '#until-for-negatives'
|
518
|
+
Enabled: true
|
519
|
+
|
520
|
+
Style/NestedModifier:
|
521
|
+
Description: 'Avoid using nested modifiers.'
|
522
|
+
StyleGuide: '#no-nested-modifiers'
|
523
|
+
Enabled: true
|
524
|
+
|
525
|
+
Style/NestedParenthesizedCalls:
|
526
|
+
Description: >-
|
527
|
+
Parenthesize method calls which are nested inside the
|
528
|
+
argument list of another parenthesized method call.
|
529
|
+
Enabled: true
|
530
|
+
|
531
|
+
Style/NestedTernaryOperator:
|
532
|
+
Description: 'Use one expression per branch in a ternary operator.'
|
533
|
+
StyleGuide: '#no-nested-ternary'
|
534
|
+
Enabled: true
|
535
|
+
|
536
|
+
Style/Next:
|
537
|
+
Description: 'Use `next` to skip iteration instead of a condition at the end.'
|
538
|
+
StyleGuide: '#no-nested-conditionals'
|
539
|
+
Enabled: true
|
540
|
+
|
541
|
+
Style/NilComparison:
|
542
|
+
Description: 'Prefer x.nil? to x == nil.'
|
543
|
+
StyleGuide: '#predicate-methods'
|
544
|
+
Enabled: true
|
545
|
+
|
546
|
+
Style/NonNilCheck:
|
547
|
+
Description: 'Checks for redundant nil checks.'
|
548
|
+
StyleGuide: '#no-non-nil-checks'
|
549
|
+
Enabled: true
|
550
|
+
|
551
|
+
Style/Not:
|
552
|
+
Description: 'Use ! instead of not.'
|
553
|
+
StyleGuide: '#bang-not-not'
|
554
|
+
Enabled: true
|
555
|
+
|
556
|
+
Style/NumericLiterals:
|
557
|
+
Description: >-
|
558
|
+
Add underscores to large numeric literals to improve their
|
559
|
+
readability.
|
560
|
+
StyleGuide: '#underscores-in-numerics'
|
561
|
+
Enabled: true
|
562
|
+
|
563
|
+
Style/NumericLiteralPrefix:
|
564
|
+
Description: 'Use smallcase prefixes for numeric literals.'
|
565
|
+
StyleGuide: '#numeric-literal-prefixes'
|
566
|
+
Enabled: true
|
567
|
+
|
568
|
+
Style/NumericPredicate:
|
569
|
+
Description: >-
|
570
|
+
Checks for the use of predicate- or comparison methods for
|
571
|
+
numeric comparisons.
|
572
|
+
StyleGuide: '#predicate-methods'
|
573
|
+
# This will change to a new method call which isn't guaranteed to be on the
|
574
|
+
# object. Switching these methods has to be done with knowledge of the types
|
575
|
+
# of the variables which rubocop doesn't have.
|
576
|
+
AutoCorrect: false
|
577
|
+
Enabled: true
|
578
|
+
|
579
|
+
Style/OneLineConditional:
|
580
|
+
Description: >-
|
581
|
+
Favor the ternary operator(?:) over
|
582
|
+
if/then/else/end constructs.
|
583
|
+
StyleGuide: '#ternary-operator'
|
584
|
+
Enabled: true
|
585
|
+
|
586
|
+
Style/OpMethod:
|
587
|
+
Description: 'When defining binary operators, name the argument other.'
|
588
|
+
StyleGuide: '#other-arg'
|
589
|
+
Enabled: true
|
590
|
+
|
591
|
+
Style/OptionalArguments:
|
592
|
+
Description: >-
|
593
|
+
Checks for optional arguments that do not appear at the end
|
594
|
+
of the argument list
|
595
|
+
StyleGuide: '#optional-arguments'
|
596
|
+
Enabled: true
|
597
|
+
|
598
|
+
Style/ParallelAssignment:
|
599
|
+
Description: >-
|
600
|
+
Check for simple usages of parallel assignment.
|
601
|
+
It will only warn when the number of variables
|
602
|
+
matches on both sides of the assignment.
|
603
|
+
StyleGuide: '#parallel-assignment'
|
604
|
+
Enabled: true
|
605
|
+
|
606
|
+
Style/ParenthesesAroundCondition:
|
607
|
+
Description: >-
|
608
|
+
Don't use parentheses around the condition of an
|
609
|
+
if/unless/while.
|
610
|
+
StyleGuide: '#no-parens-around-condition'
|
611
|
+
Enabled: true
|
612
|
+
|
613
|
+
Style/PercentLiteralDelimiters:
|
614
|
+
Description: 'Use `%`-literal delimiters consistently'
|
615
|
+
StyleGuide: '#percent-literal-braces'
|
616
|
+
Enabled: true
|
617
|
+
|
618
|
+
Style/PercentQLiterals:
|
619
|
+
Description: 'Checks if uses of %Q/%q match the configured preference.'
|
620
|
+
Enabled: true
|
621
|
+
|
622
|
+
Style/PerlBackrefs:
|
623
|
+
Description: 'Avoid Perl-style regex back references.'
|
624
|
+
StyleGuide: '#no-perl-regexp-last-matchers'
|
625
|
+
Enabled: true
|
626
|
+
|
627
|
+
Style/PredicateName:
|
628
|
+
Description: 'Check the names of predicate methods.'
|
629
|
+
StyleGuide: '#bool-methods-qmark'
|
630
|
+
Enabled: true
|
631
|
+
|
632
|
+
Style/PreferredHashMethods:
|
633
|
+
Description: 'Checks use of `has_key?` and `has_value?` Hash methods.'
|
634
|
+
StyleGuide: '#hash-key'
|
635
|
+
Enabled: true
|
636
|
+
|
637
|
+
Style/Proc:
|
638
|
+
Description: 'Use proc instead of Proc.new.'
|
639
|
+
StyleGuide: '#proc'
|
640
|
+
Enabled: true
|
641
|
+
|
642
|
+
Style/RaiseArgs:
|
643
|
+
Description: 'Checks the arguments passed to raise/fail.'
|
644
|
+
StyleGuide: '#exception-class-messages'
|
645
|
+
Enabled: true
|
646
|
+
|
647
|
+
Style/RedundantBegin:
|
648
|
+
Description: "Don't use begin blocks when they are not needed."
|
649
|
+
StyleGuide: '#begin-implicit'
|
650
|
+
Enabled: true
|
651
|
+
|
652
|
+
Style/RedundantException:
|
653
|
+
Description: "Checks for an obsolete RuntimeException argument in raise/fail."
|
654
|
+
StyleGuide: '#no-explicit-runtimeerror'
|
655
|
+
Enabled: true
|
656
|
+
|
657
|
+
Style/RedundantFreeze:
|
658
|
+
Description: "Checks usages of Object#freeze on immutable objects."
|
659
|
+
Enabled: true
|
660
|
+
|
661
|
+
Style/RedundantParentheses:
|
662
|
+
Description: "Checks for parentheses that seem not to serve any purpose."
|
663
|
+
Enabled: true
|
664
|
+
|
665
|
+
Style/RedundantReturn:
|
666
|
+
Description: "Don't use return where it's not required."
|
667
|
+
StyleGuide: '#no-explicit-return'
|
668
|
+
Enabled: true
|
669
|
+
|
670
|
+
Style/RedundantSelf:
|
671
|
+
Description: "Don't use self where it's not needed."
|
672
|
+
StyleGuide: '#no-self-unless-required'
|
673
|
+
Enabled: true
|
674
|
+
|
675
|
+
Style/RegexpLiteral:
|
676
|
+
Description: 'Use / or %r around regular expressions.'
|
677
|
+
StyleGuide: '#percent-r'
|
678
|
+
Enabled: true
|
679
|
+
|
680
|
+
Style/RescueEnsureAlignment:
|
681
|
+
Description: 'Align rescues and ensures correctly.'
|
682
|
+
Enabled: true
|
683
|
+
|
684
|
+
Style/RescueModifier:
|
685
|
+
Description: 'Avoid using rescue in its modifier form.'
|
686
|
+
StyleGuide: '#no-rescue-modifiers'
|
687
|
+
Enabled: true
|
688
|
+
|
689
|
+
Style/SafeNavigation:
|
690
|
+
Description: >-
|
691
|
+
This cop transforms usages of a method call safeguarded by
|
692
|
+
a check for the existance of the object to
|
693
|
+
safe navigation (`&.`).
|
694
|
+
Enabled: true
|
695
|
+
|
696
|
+
Style/SelfAssignment:
|
697
|
+
Description: >-
|
698
|
+
Checks for places where self-assignment shorthand should have
|
699
|
+
been used.
|
700
|
+
StyleGuide: '#self-assignment'
|
701
|
+
Enabled: true
|
702
|
+
|
703
|
+
Style/Semicolon:
|
704
|
+
Description: "Don't use semicolons to terminate expressions."
|
705
|
+
StyleGuide: '#no-semicolon'
|
706
|
+
Enabled: true
|
707
|
+
|
708
|
+
Style/SignalException:
|
709
|
+
Description: 'Checks for proper usage of fail and raise.'
|
710
|
+
StyleGuide: '#prefer-raise-over-fail'
|
711
|
+
Enabled: true
|
712
|
+
|
713
|
+
Style/SingleLineMethods:
|
714
|
+
Description: 'Avoid single-line methods.'
|
715
|
+
StyleGuide: '#no-single-line-methods'
|
716
|
+
Enabled: true
|
717
|
+
|
718
|
+
Style/SpaceBeforeFirstArg:
|
719
|
+
Description: >-
|
720
|
+
Checks that exactly one space is used between a method name
|
721
|
+
and the first argument for method calls without parentheses.
|
722
|
+
Enabled: true
|
723
|
+
|
724
|
+
Style/SpaceAfterColon:
|
725
|
+
Description: 'Use spaces after colons.'
|
726
|
+
StyleGuide: '#spaces-operators'
|
727
|
+
Enabled: true
|
728
|
+
|
729
|
+
Style/SpaceAfterComma:
|
730
|
+
Description: 'Use spaces after commas.'
|
731
|
+
StyleGuide: '#spaces-operators'
|
732
|
+
Enabled: true
|
733
|
+
|
734
|
+
Style/SpaceAfterMethodName:
|
735
|
+
Description: >-
|
736
|
+
Do not put a space between a method name and the opening
|
737
|
+
parenthesis in a method definition.
|
738
|
+
StyleGuide: '#parens-no-spaces'
|
739
|
+
Enabled: true
|
740
|
+
|
741
|
+
Style/SpaceAfterNot:
|
742
|
+
Description: Tracks redundant space after the ! operator.
|
743
|
+
StyleGuide: '#no-space-bang'
|
744
|
+
Enabled: true
|
745
|
+
|
746
|
+
Style/SpaceAfterSemicolon:
|
747
|
+
Description: 'Use spaces after semicolons.'
|
748
|
+
StyleGuide: '#spaces-operators'
|
749
|
+
Enabled: true
|
750
|
+
|
751
|
+
Style/SpaceBeforeBlockBraces:
|
752
|
+
Description: >-
|
753
|
+
Checks that the left block brace has or doesn't have space
|
754
|
+
before it.
|
755
|
+
Enabled: true
|
756
|
+
|
757
|
+
Style/SpaceBeforeComma:
|
758
|
+
Description: 'No spaces before commas.'
|
759
|
+
Enabled: true
|
760
|
+
|
761
|
+
Style/SpaceBeforeComment:
|
762
|
+
Description: >-
|
763
|
+
Checks for missing space between code and a comment on the
|
764
|
+
same line.
|
765
|
+
Enabled: true
|
766
|
+
|
767
|
+
Style/SpaceBeforeSemicolon:
|
768
|
+
Description: 'No spaces before semicolons.'
|
769
|
+
Enabled: true
|
770
|
+
|
771
|
+
Style/SpaceInsideBlockBraces:
|
772
|
+
Description: >-
|
773
|
+
Checks that block braces have or don't have surrounding space.
|
774
|
+
For blocks taking parameters, checks that the left brace has
|
775
|
+
or doesn't have trailing space.
|
776
|
+
Enabled: true
|
777
|
+
|
778
|
+
Style/SpaceAroundBlockParameters:
|
779
|
+
Description: 'Checks the spacing inside and after block parameters pipes.'
|
780
|
+
Enabled: true
|
781
|
+
|
782
|
+
Style/SpaceAroundEqualsInParameterDefault:
|
783
|
+
Description: >-
|
784
|
+
Checks that the equals signs in parameter default assignments
|
785
|
+
have or don't have surrounding space depending on
|
786
|
+
configuration.
|
787
|
+
StyleGuide: '#spaces-around-equals'
|
788
|
+
Enabled: true
|
789
|
+
|
790
|
+
Style/SpaceAroundKeyword:
|
791
|
+
Description: 'Use a space around keywords if appropriate.'
|
792
|
+
Enabled: true
|
793
|
+
|
794
|
+
Style/SpaceAroundOperators:
|
795
|
+
Description: 'Use a single space around operators.'
|
796
|
+
StyleGuide: '#spaces-operators'
|
797
|
+
Enabled: true
|
798
|
+
|
799
|
+
Style/SpaceInsideArrayPercentLiteral:
|
800
|
+
Description: 'No unnecessary additional spaces between elements in %i/%w literals.'
|
801
|
+
Enabled: true
|
802
|
+
|
803
|
+
Style/SpaceInsidePercentLiteralDelimiters:
|
804
|
+
Description: 'No unnecessary spaces inside delimiters of %i/%w/%x literals.'
|
805
|
+
Enabled: true
|
806
|
+
|
807
|
+
Style/SpaceInsideBrackets:
|
808
|
+
Description: 'No spaces after [ or before ].'
|
809
|
+
StyleGuide: '#no-spaces-braces'
|
810
|
+
Enabled: true
|
811
|
+
|
812
|
+
Style/SpaceInsideHashLiteralBraces:
|
813
|
+
Description: "Use spaces inside hash literal braces - or don't."
|
814
|
+
StyleGuide: '#spaces-operators'
|
815
|
+
Enabled: true
|
816
|
+
|
817
|
+
Style/SpaceInsideParens:
|
818
|
+
Description: 'No spaces after ( or before ).'
|
819
|
+
StyleGuide: '#no-spaces-braces'
|
820
|
+
Enabled: true
|
821
|
+
|
822
|
+
Style/SpaceInsideRangeLiteral:
|
823
|
+
Description: 'No spaces inside range literals.'
|
824
|
+
StyleGuide: '#no-space-inside-range-literals'
|
825
|
+
Enabled: true
|
826
|
+
|
827
|
+
Style/SpaceInsideStringInterpolation:
|
828
|
+
Description: 'Checks for padding/surrounding spaces inside string interpolation.'
|
829
|
+
StyleGuide: '#string-interpolation'
|
830
|
+
Enabled: true
|
831
|
+
|
832
|
+
Style/SpecialGlobalVars:
|
833
|
+
Description: 'Avoid Perl-style global variables.'
|
834
|
+
StyleGuide: '#no-cryptic-perlisms'
|
835
|
+
Enabled: true
|
836
|
+
|
837
|
+
Style/StabbyLambdaParentheses:
|
838
|
+
Description: 'Check for the usage of parentheses around stabby lambda arguments.'
|
839
|
+
StyleGuide: '#stabby-lambda-with-args'
|
840
|
+
Enabled: true
|
841
|
+
|
842
|
+
Style/StringLiterals:
|
843
|
+
Description: 'Checks if uses of quotes match the configured preference.'
|
844
|
+
StyleGuide: '#consistent-string-literals'
|
845
|
+
Enabled: true
|
846
|
+
|
847
|
+
Style/StringLiteralsInInterpolation:
|
848
|
+
Description: >-
|
849
|
+
Checks if uses of quotes inside expressions in interpolated
|
850
|
+
strings match the configured preference.
|
851
|
+
Enabled: true
|
852
|
+
|
853
|
+
Style/StructInheritance:
|
854
|
+
Description: 'Checks for inheritance from Struct.new.'
|
855
|
+
StyleGuide: '#no-extend-struct-new'
|
856
|
+
Enabled: true
|
857
|
+
|
858
|
+
Style/SymbolLiteral:
|
859
|
+
Description: 'Use plain symbols instead of string symbols when possible.'
|
860
|
+
Enabled: true
|
861
|
+
|
862
|
+
Style/SymbolProc:
|
863
|
+
Description: 'Use symbols as procs instead of blocks when possible.'
|
864
|
+
Enabled: true
|
865
|
+
|
866
|
+
Style/Tab:
|
867
|
+
Description: 'No hard tabs.'
|
868
|
+
StyleGuide: '#spaces-indentation'
|
869
|
+
Enabled: true
|
870
|
+
|
871
|
+
Style/TernaryParentheses:
|
872
|
+
Description: 'Checks for use of parentheses around ternary conditions.'
|
873
|
+
Enabled: true
|
874
|
+
|
875
|
+
Style/TrailingBlankLines:
|
876
|
+
Description: 'Checks trailing blank lines and final newline.'
|
877
|
+
StyleGuide: '#newline-eof'
|
878
|
+
Enabled: true
|
879
|
+
|
880
|
+
Style/TrailingCommaInArguments:
|
881
|
+
Description: 'Checks for trailing comma in argument lists.'
|
882
|
+
StyleGuide: '#no-trailing-params-comma'
|
883
|
+
Enabled: true
|
884
|
+
|
885
|
+
Style/TrailingCommaInLiteral:
|
886
|
+
Description: 'Checks for trailing comma in array and hash literals.'
|
887
|
+
StyleGuide: '#no-trailing-array-commas'
|
888
|
+
Enabled: true
|
889
|
+
|
890
|
+
Style/TrailingWhitespace:
|
891
|
+
Description: 'Avoid trailing whitespace.'
|
892
|
+
StyleGuide: '#no-trailing-whitespace'
|
893
|
+
Enabled: true
|
894
|
+
|
895
|
+
Style/TrivialAccessors:
|
896
|
+
Description: 'Prefer attr_* methods to trivial readers/writers.'
|
897
|
+
StyleGuide: '#attr_family'
|
898
|
+
Enabled: true
|
899
|
+
|
900
|
+
Style/UnlessElse:
|
901
|
+
Description: >-
|
902
|
+
Do not use unless with else. Rewrite these with the positive
|
903
|
+
case first.
|
904
|
+
StyleGuide: '#no-else-with-unless'
|
905
|
+
Enabled: true
|
906
|
+
|
907
|
+
Style/UnneededCapitalW:
|
908
|
+
Description: 'Checks for %W when interpolation is not needed.'
|
909
|
+
Enabled: true
|
910
|
+
|
911
|
+
Style/UnneededInterpolation:
|
912
|
+
Description: 'Checks for strings that are just an interpolated expression.'
|
913
|
+
Enabled: true
|
914
|
+
|
915
|
+
Style/UnneededPercentQ:
|
916
|
+
Description: 'Checks for %q/%Q when single quotes or double quotes would do.'
|
917
|
+
StyleGuide: '#percent-q'
|
918
|
+
Enabled: true
|
919
|
+
|
920
|
+
Style/TrailingUnderscoreVariable:
|
921
|
+
Description: >-
|
922
|
+
Checks for the usage of unneeded trailing underscores at the
|
923
|
+
end of parallel variable assignment.
|
924
|
+
AllowNamedUnderscoreVariables: true
|
925
|
+
Enabled: true
|
926
|
+
|
927
|
+
Style/VariableInterpolation:
|
928
|
+
Description: >-
|
929
|
+
Don't interpolate global, instance and class variables
|
930
|
+
directly in strings.
|
931
|
+
StyleGuide: '#curlies-interpolate'
|
932
|
+
Enabled: true
|
933
|
+
|
934
|
+
Style/VariableName:
|
935
|
+
Description: 'Use the configured style when naming variables.'
|
936
|
+
StyleGuide: '#snake-case-symbols-methods-vars'
|
937
|
+
Enabled: true
|
938
|
+
|
939
|
+
Style/VariableNumber:
|
940
|
+
Description: 'Use the configured style when numbering variables.'
|
941
|
+
Enabled: true
|
942
|
+
|
943
|
+
Style/WhenThen:
|
944
|
+
Description: 'Use when x then ... for one-line cases.'
|
945
|
+
StyleGuide: '#one-line-cases'
|
946
|
+
Enabled: true
|
947
|
+
|
948
|
+
Style/WhileUntilDo:
|
949
|
+
Description: 'Checks for redundant do after while or until.'
|
950
|
+
StyleGuide: '#no-multiline-while-do'
|
951
|
+
Enabled: true
|
952
|
+
|
953
|
+
Style/WhileUntilModifier:
|
954
|
+
Description: >-
|
955
|
+
Favor modifier while/until usage when you have a
|
956
|
+
single-line body.
|
957
|
+
StyleGuide: '#while-as-a-modifier'
|
958
|
+
Enabled: true
|
959
|
+
|
960
|
+
Style/WordArray:
|
961
|
+
Description: 'Use %w or %W for arrays of words.'
|
962
|
+
StyleGuide: '#percent-w'
|
963
|
+
Enabled: true
|
964
|
+
|
965
|
+
Style/ZeroLengthPredicate:
|
966
|
+
Description: 'Use #empty? when testing for objects of length 0.'
|
967
|
+
Enabled: true
|
968
|
+
|
969
|
+
#################### Metrics ################################
|
970
|
+
|
971
|
+
Metrics/AbcSize:
|
972
|
+
Description: >-
|
973
|
+
A calculated magnitude based on number of assignments,
|
974
|
+
branches, and conditions.
|
975
|
+
Reference: 'http://c2.com/cgi/wiki?AbcMetric'
|
976
|
+
Enabled: true
|
977
|
+
|
978
|
+
Metrics/BlockNesting:
|
979
|
+
Description: 'Avoid excessive block nesting'
|
980
|
+
StyleGuide: '#three-is-the-number-thou-shalt-count'
|
981
|
+
Enabled: true
|
982
|
+
|
983
|
+
Metrics/ClassLength:
|
984
|
+
Description: 'Avoid classes longer than 100 lines of code.'
|
985
|
+
Enabled: true
|
986
|
+
|
987
|
+
Metrics/ModuleLength:
|
988
|
+
Description: 'Avoid modules longer than 100 lines of code.'
|
989
|
+
Enabled: true
|
990
|
+
|
991
|
+
Metrics/CyclomaticComplexity:
|
992
|
+
Description: >-
|
993
|
+
A complexity metric that is strongly correlated to the number
|
994
|
+
of test cases needed to validate a method.
|
995
|
+
Enabled: true
|
996
|
+
|
997
|
+
Metrics/LineLength:
|
998
|
+
Description: 'Limit lines to 80 characters.'
|
999
|
+
StyleGuide: '#80-character-limits'
|
1000
|
+
Enabled: true
|
1001
|
+
|
1002
|
+
Metrics/MethodLength:
|
1003
|
+
Description: 'Avoid methods longer than 10 lines of code.'
|
1004
|
+
StyleGuide: '#short-methods'
|
1005
|
+
Enabled: true
|
1006
|
+
|
1007
|
+
Metrics/BlockLength:
|
1008
|
+
Description: 'Avoid long blocks with many lines.'
|
1009
|
+
Enabled: true
|
1010
|
+
|
1011
|
+
Metrics/ParameterLists:
|
1012
|
+
Description: 'Avoid parameter lists longer than three or four parameters.'
|
1013
|
+
StyleGuide: '#too-many-params'
|
1014
|
+
Enabled: true
|
1015
|
+
|
1016
|
+
Metrics/PerceivedComplexity:
|
1017
|
+
Description: >-
|
1018
|
+
A complexity metric geared towards measuring complexity for a
|
1019
|
+
human reader.
|
1020
|
+
Enabled: true
|
1021
|
+
|
1022
|
+
#################### Lint ################################
|
1023
|
+
### Warnings
|
1024
|
+
|
1025
|
+
Lint/AmbiguousOperator:
|
1026
|
+
Description: >-
|
1027
|
+
Checks for ambiguous operators in the first argument of a
|
1028
|
+
method invocation without parentheses.
|
1029
|
+
StyleGuide: '#method-invocation-parens'
|
1030
|
+
Enabled: true
|
1031
|
+
|
1032
|
+
Lint/AmbiguousRegexpLiteral:
|
1033
|
+
Description: >-
|
1034
|
+
Checks for ambiguous regexp literals in the first argument of
|
1035
|
+
a method invocation without parentheses.
|
1036
|
+
Enabled: true
|
1037
|
+
|
1038
|
+
Lint/AssignmentInCondition:
|
1039
|
+
Description: "Don't use assignment in conditions."
|
1040
|
+
StyleGuide: '#safe-assignment-in-condition'
|
1041
|
+
Enabled: true
|
1042
|
+
|
1043
|
+
Lint/BlockAlignment:
|
1044
|
+
Description: 'Align block ends correctly.'
|
1045
|
+
Enabled: true
|
1046
|
+
|
1047
|
+
Lint/CircularArgumentReference:
|
1048
|
+
Description: "Default values in optional keyword arguments and optional ordinal arguments should not refer back to the name of the argument."
|
1049
|
+
Enabled: true
|
1050
|
+
|
1051
|
+
Lint/ConditionPosition:
|
1052
|
+
Description: >-
|
1053
|
+
Checks for condition placed in a confusing position relative to
|
1054
|
+
the keyword.
|
1055
|
+
StyleGuide: '#same-line-condition'
|
1056
|
+
Enabled: true
|
1057
|
+
|
1058
|
+
Lint/Debugger:
|
1059
|
+
Description: 'Check for debugger calls.'
|
1060
|
+
Enabled: true
|
1061
|
+
|
1062
|
+
Lint/DefEndAlignment:
|
1063
|
+
Description: 'Align ends corresponding to defs correctly.'
|
1064
|
+
Enabled: true
|
1065
|
+
|
1066
|
+
Lint/DeprecatedClassMethods:
|
1067
|
+
Description: 'Check for deprecated class method calls.'
|
1068
|
+
Enabled: true
|
1069
|
+
|
1070
|
+
Lint/DuplicateCaseCondition:
|
1071
|
+
Description: 'Do not repeat values in case conditionals.'
|
1072
|
+
Enabled: true
|
1073
|
+
|
1074
|
+
Lint/DuplicateMethods:
|
1075
|
+
Description: 'Check for duplicate method definitions.'
|
1076
|
+
Enabled: true
|
1077
|
+
|
1078
|
+
Lint/DuplicatedKey:
|
1079
|
+
Description: 'Check for duplicate keys in hash literals.'
|
1080
|
+
Enabled: true
|
1081
|
+
|
1082
|
+
Lint/EachWithObjectArgument:
|
1083
|
+
Description: 'Check for immutable argument given to each_with_object.'
|
1084
|
+
Enabled: true
|
1085
|
+
|
1086
|
+
Lint/ElseLayout:
|
1087
|
+
Description: 'Check for odd code arrangement in an else block.'
|
1088
|
+
Enabled: true
|
1089
|
+
|
1090
|
+
Lint/EmptyEnsure:
|
1091
|
+
Description: 'Checks for empty ensure block.'
|
1092
|
+
Enabled: true
|
1093
|
+
|
1094
|
+
Lint/EmptyExpression:
|
1095
|
+
Description: 'Checks for empty expressions.'
|
1096
|
+
Enabled: true
|
1097
|
+
|
1098
|
+
Lint/EmptyInterpolation:
|
1099
|
+
Description: 'Checks for empty string interpolation.'
|
1100
|
+
Enabled: true
|
1101
|
+
|
1102
|
+
Lint/EmptyWhen:
|
1103
|
+
Description: 'Checks for `when` branches with empty bodies.'
|
1104
|
+
Enabled: true
|
1105
|
+
|
1106
|
+
Lint/EndAlignment:
|
1107
|
+
Description: 'Align ends correctly.'
|
1108
|
+
Enabled: true
|
1109
|
+
|
1110
|
+
Lint/EndInMethod:
|
1111
|
+
Description: 'END blocks should not be placed inside method definitions.'
|
1112
|
+
Enabled: true
|
1113
|
+
|
1114
|
+
Lint/EnsureReturn:
|
1115
|
+
Description: 'Do not use return in an ensure block.'
|
1116
|
+
StyleGuide: '#no-return-ensure'
|
1117
|
+
Enabled: true
|
1118
|
+
|
1119
|
+
Lint/FloatOutOfRange:
|
1120
|
+
Description: >-
|
1121
|
+
Catches floating-point literals too large or small for Ruby to
|
1122
|
+
represent.
|
1123
|
+
Enabled: true
|
1124
|
+
|
1125
|
+
Lint/FormatParameterMismatch:
|
1126
|
+
Description: 'The number of parameters to format/sprint must match the fields.'
|
1127
|
+
Enabled: true
|
1128
|
+
|
1129
|
+
Lint/HandleExceptions:
|
1130
|
+
Description: "Don't suppress exception."
|
1131
|
+
StyleGuide: '#dont-hide-exceptions'
|
1132
|
+
Enabled: true
|
1133
|
+
|
1134
|
+
Lint/ImplicitStringConcatenation:
|
1135
|
+
Description: >-
|
1136
|
+
Checks for adjacent string literals on the same line, which
|
1137
|
+
could better be represented as a single string literal.
|
1138
|
+
Enabled: true
|
1139
|
+
|
1140
|
+
Lint/IneffectiveAccessModifier:
|
1141
|
+
Description: >-
|
1142
|
+
Checks for attempts to use `private` or `protected` to set
|
1143
|
+
the visibility of a class method, which does not work.
|
1144
|
+
Enabled: true
|
1145
|
+
|
1146
|
+
Lint/InheritException:
|
1147
|
+
Description: 'Avoid inheriting from the `Exception` class.'
|
1148
|
+
Enabled: true
|
1149
|
+
|
1150
|
+
Lint/InvalidCharacterLiteral:
|
1151
|
+
Description: >-
|
1152
|
+
Checks for invalid character literals with a non-escaped
|
1153
|
+
whitespace character.
|
1154
|
+
Enabled: true
|
1155
|
+
|
1156
|
+
Lint/LiteralInCondition:
|
1157
|
+
Description: 'Checks of literals used in conditions.'
|
1158
|
+
Enabled: true
|
1159
|
+
|
1160
|
+
Lint/LiteralInInterpolation:
|
1161
|
+
Description: 'Checks for literals used in interpolation.'
|
1162
|
+
Enabled: true
|
1163
|
+
|
1164
|
+
Lint/Loop:
|
1165
|
+
Description: >-
|
1166
|
+
Use Kernel#loop with break rather than begin/end/until or
|
1167
|
+
begin/end/while for post-loop tests.
|
1168
|
+
StyleGuide: '#loop-with-break'
|
1169
|
+
Enabled: true
|
1170
|
+
|
1171
|
+
Lint/MultipleCompare:
|
1172
|
+
Description: "Use `&&` operator to compare multiple value."
|
1173
|
+
Enabled: true
|
1174
|
+
|
1175
|
+
Lint/NestedMethodDefinition:
|
1176
|
+
Description: 'Do not use nested method definitions.'
|
1177
|
+
StyleGuide: '#no-nested-methods'
|
1178
|
+
Enabled: true
|
1179
|
+
|
1180
|
+
Lint/NextWithoutAccumulator:
|
1181
|
+
Description: >-
|
1182
|
+
Do not omit the accumulator when calling `next`
|
1183
|
+
in a `reduce`/`inject` block.
|
1184
|
+
Enabled: true
|
1185
|
+
|
1186
|
+
Lint/NonLocalExitFromIterator:
|
1187
|
+
Description: 'Do not use return in iterator to cause non-local exit.'
|
1188
|
+
Enabled: true
|
1189
|
+
|
1190
|
+
Lint/ParenthesesAsGroupedExpression:
|
1191
|
+
Description: >-
|
1192
|
+
Checks for method calls with a space before the opening
|
1193
|
+
parenthesis.
|
1194
|
+
StyleGuide: '#parens-no-spaces'
|
1195
|
+
Enabled: true
|
1196
|
+
|
1197
|
+
Lint/PercentStringArray:
|
1198
|
+
Description: >-
|
1199
|
+
Checks for unwanted commas and quotes in %w/%W literals.
|
1200
|
+
Enabled: true
|
1201
|
+
|
1202
|
+
Lint/PercentSymbolArray:
|
1203
|
+
Description: >-
|
1204
|
+
Checks for unwanted commas and colons in %i/%I literals.
|
1205
|
+
Enabled: true
|
1206
|
+
|
1207
|
+
Lint/RandOne:
|
1208
|
+
Description: >-
|
1209
|
+
Checks for `rand(1)` calls. Such calls always return `0`
|
1210
|
+
and most likely a mistake.
|
1211
|
+
Enabled: true
|
1212
|
+
|
1213
|
+
Lint/RequireParentheses:
|
1214
|
+
Description: >-
|
1215
|
+
Use parentheses in the method call to avoid confusion
|
1216
|
+
about precedence.
|
1217
|
+
Enabled: true
|
1218
|
+
|
1219
|
+
Lint/RescueException:
|
1220
|
+
Description: 'Avoid rescuing the Exception class.'
|
1221
|
+
StyleGuide: '#no-blind-rescues'
|
1222
|
+
Enabled: true
|
1223
|
+
|
1224
|
+
Lint/SafeNavigationChain:
|
1225
|
+
Description: 'Do not chain ordinary method call after safe navigation operator.'
|
1226
|
+
Enabled: true
|
1227
|
+
|
1228
|
+
Lint/ShadowedException:
|
1229
|
+
Description: >-
|
1230
|
+
Avoid rescuing a higher level exception
|
1231
|
+
before a lower level exception.
|
1232
|
+
Enabled: true
|
1233
|
+
|
1234
|
+
Lint/ShadowingOuterLocalVariable:
|
1235
|
+
Description: >-
|
1236
|
+
Do not use the same name as outer local variable
|
1237
|
+
for block arguments or block local variables.
|
1238
|
+
Enabled: true
|
1239
|
+
|
1240
|
+
Lint/StringConversionInInterpolation:
|
1241
|
+
Description: 'Checks for Object#to_s usage in string interpolation.'
|
1242
|
+
StyleGuide: '#no-to-s'
|
1243
|
+
Enabled: true
|
1244
|
+
|
1245
|
+
Lint/UnderscorePrefixedVariableName:
|
1246
|
+
Description: 'Do not use prefix `_` for a variable that is used.'
|
1247
|
+
Enabled: true
|
1248
|
+
|
1249
|
+
Lint/UnifiedInteger:
|
1250
|
+
Description: 'Use Integer instead of Fixnum or Bignum'
|
1251
|
+
Enabled: true
|
1252
|
+
|
1253
|
+
Lint/UnneededDisable:
|
1254
|
+
Description: >-
|
1255
|
+
Checks for rubocop:disable comments that can be removed.
|
1256
|
+
Note: this cop is not disabled when disabling all cops.
|
1257
|
+
It must be explicitly disabled.
|
1258
|
+
Enabled: true
|
1259
|
+
|
1260
|
+
Lint/UnneededSplatExpansion:
|
1261
|
+
Description: 'Checks for splat unnecessarily being called on literals'
|
1262
|
+
Enabled: true
|
1263
|
+
|
1264
|
+
Lint/UnusedBlockArgument:
|
1265
|
+
Description: 'Checks for unused block arguments.'
|
1266
|
+
StyleGuide: '#underscore-unused-vars'
|
1267
|
+
Enabled: true
|
1268
|
+
|
1269
|
+
Lint/UnusedMethodArgument:
|
1270
|
+
Description: 'Checks for unused method arguments.'
|
1271
|
+
StyleGuide: '#underscore-unused-vars'
|
1272
|
+
Enabled: true
|
1273
|
+
|
1274
|
+
Lint/UnreachableCode:
|
1275
|
+
Description: 'Unreachable code.'
|
1276
|
+
Enabled: true
|
1277
|
+
|
1278
|
+
Lint/UselessAccessModifier:
|
1279
|
+
Description: 'Checks for useless access modifiers.'
|
1280
|
+
Enabled: true
|
1281
|
+
ContextCreatingMethods: []
|
1282
|
+
|
1283
|
+
Lint/UselessAssignment:
|
1284
|
+
Description: 'Checks for useless assignment to a local variable.'
|
1285
|
+
StyleGuide: '#underscore-unused-vars'
|
1286
|
+
Enabled: true
|
1287
|
+
|
1288
|
+
Lint/UselessComparison:
|
1289
|
+
Description: 'Checks for comparison of something with itself.'
|
1290
|
+
Enabled: true
|
1291
|
+
|
1292
|
+
Lint/UselessElseWithoutRescue:
|
1293
|
+
Description: 'Checks for useless `else` in `begin..end` without `rescue`.'
|
1294
|
+
Enabled: true
|
1295
|
+
|
1296
|
+
Lint/UselessSetterCall:
|
1297
|
+
Description: 'Checks for useless setter call to a local variable.'
|
1298
|
+
Enabled: true
|
1299
|
+
|
1300
|
+
Lint/Void:
|
1301
|
+
Description: 'Possible use of operator/literal/variable in void context.'
|
1302
|
+
Enabled: true
|
1303
|
+
|
1304
|
+
##################### Performance #############################
|
1305
|
+
|
1306
|
+
Performance/Casecmp:
|
1307
|
+
Description: >-
|
1308
|
+
Use `casecmp` rather than `downcase ==`, `upcase ==`, `== downcase`, or `== upcase`..
|
1309
|
+
Reference: 'https://github.com/JuanitoFatas/fast-ruby#stringcasecmp-vs-stringdowncase---code'
|
1310
|
+
Enabled: true
|
1311
|
+
|
1312
|
+
Performance/CaseWhenSplat:
|
1313
|
+
Description: >-
|
1314
|
+
Place `when` conditions that use splat at the end
|
1315
|
+
of the list of `when` branches.
|
1316
|
+
Enabled: true
|
1317
|
+
|
1318
|
+
Performance/Count:
|
1319
|
+
Description: >-
|
1320
|
+
Use `count` instead of `select...size`, `reject...size`,
|
1321
|
+
`select...count`, `reject...count`, `select...length`,
|
1322
|
+
and `reject...length`.
|
1323
|
+
# This cop has known compatibility issues with `ActiveRecord` and other
|
1324
|
+
# frameworks. ActiveRecord's `count` ignores the block that is passed to it.
|
1325
|
+
# For more information, see the documentation in the cop itself.
|
1326
|
+
# If you understand the known risk, you can disable `SafeMode`.
|
1327
|
+
SafeMode: true
|
1328
|
+
Enabled: true
|
1329
|
+
|
1330
|
+
Performance/Detect:
|
1331
|
+
Description: >-
|
1332
|
+
Use `detect` instead of `select.first`, `find_all.first`,
|
1333
|
+
`select.last`, and `find_all.last`.
|
1334
|
+
Reference: 'https://github.com/JuanitoFatas/fast-ruby#enumerabledetect-vs-enumerableselectfirst-code'
|
1335
|
+
# This cop has known compatibility issues with `ActiveRecord` and other
|
1336
|
+
# frameworks. `ActiveRecord` does not implement a `detect` method and `find`
|
1337
|
+
# has its own meaning. Correcting `ActiveRecord` methods with this cop
|
1338
|
+
# should be considered unsafe.
|
1339
|
+
SafeMode: true
|
1340
|
+
Enabled: true
|
1341
|
+
|
1342
|
+
Performance/DoubleStartEndWith:
|
1343
|
+
Description: >-
|
1344
|
+
Use `str.{start,end}_with?(x, ..., y, ...)`
|
1345
|
+
instead of `str.{start,end}_with?(x, ...) || str.{start,end}_with?(y, ...)`.
|
1346
|
+
Enabled: true
|
1347
|
+
|
1348
|
+
Performance/EndWith:
|
1349
|
+
Description: 'Use `end_with?` instead of a regex match anchored to the end of a string.'
|
1350
|
+
Reference: 'https://github.com/JuanitoFatas/fast-ruby#stringmatch-vs-stringstart_withstringend_with-code-start-code-end'
|
1351
|
+
# This will change to a new method call which isn't guaranteed to be on the
|
1352
|
+
# object. Switching these methods has to be done with knowledge of the types
|
1353
|
+
# of the variables which rubocop doesn't have.
|
1354
|
+
AutoCorrect: false
|
1355
|
+
Enabled: true
|
1356
|
+
|
1357
|
+
Performance/FixedSize:
|
1358
|
+
Description: 'Do not compute the size of statically sized objects except in constants'
|
1359
|
+
Enabled: true
|
1360
|
+
|
1361
|
+
Performance/FlatMap:
|
1362
|
+
Description: >-
|
1363
|
+
Use `Enumerable#flat_map`
|
1364
|
+
instead of `Enumerable#map...Array#flatten(1)`
|
1365
|
+
or `Enumberable#collect..Array#flatten(1)`
|
1366
|
+
Reference: 'https://github.com/JuanitoFatas/fast-ruby#enumerablemaparrayflatten-vs-enumerableflat_map-code'
|
1367
|
+
Enabled: true
|
1368
|
+
EnabledForFlattenWithoutParams: false
|
1369
|
+
# If enabled, this cop will warn about usages of
|
1370
|
+
# `flatten` being called without any parameters.
|
1371
|
+
# This can be dangerous since `flat_map` will only flatten 1 level, and
|
1372
|
+
# `flatten` without any parameters can flatten multiple levels.
|
1373
|
+
|
1374
|
+
Performance/HashEachMethods:
|
1375
|
+
Description: >-
|
1376
|
+
Use `Hash#each_key` and `Hash#each_value` instead of
|
1377
|
+
`Hash#keys.each` and `Hash#values.each`.
|
1378
|
+
StyleGuide: '#hash-each'
|
1379
|
+
Enabled: true
|
1380
|
+
AutoCorrect: false
|
1381
|
+
|
1382
|
+
Performance/LstripRstrip:
|
1383
|
+
Description: 'Use `strip` instead of `lstrip.rstrip`.'
|
1384
|
+
Enabled: true
|
1385
|
+
|
1386
|
+
Performance/RangeInclude:
|
1387
|
+
Description: 'Use `Range#cover?` instead of `Range#include?`.'
|
1388
|
+
Reference: 'https://github.com/JuanitoFatas/fast-ruby#cover-vs-include-code'
|
1389
|
+
Enabled: true
|
1390
|
+
|
1391
|
+
Performance/RedundantBlockCall:
|
1392
|
+
Description: 'Use `yield` instead of `block.call`.'
|
1393
|
+
Reference: 'https://github.com/JuanitoFatas/fast-ruby#proccall-vs-yield-code'
|
1394
|
+
Enabled: true
|
1395
|
+
|
1396
|
+
Performance/RedundantMatch:
|
1397
|
+
Description: >-
|
1398
|
+
Use `=~` instead of `String#match` or `Regexp#match` in a context where the
|
1399
|
+
returned `MatchData` is not needed.
|
1400
|
+
Enabled: true
|
1401
|
+
|
1402
|
+
Performance/RedundantMerge:
|
1403
|
+
Description: 'Use Hash#[]=, rather than Hash#merge! with a single key-value pair.'
|
1404
|
+
Reference: 'https://github.com/JuanitoFatas/fast-ruby#hashmerge-vs-hash-code'
|
1405
|
+
Enabled: true
|
1406
|
+
|
1407
|
+
Performance/RedundantSortBy:
|
1408
|
+
Description: 'Use `sort` instead of `sort_by { |x| x }`.'
|
1409
|
+
Enabled: true
|
1410
|
+
|
1411
|
+
Performance/RegexpMatch:
|
1412
|
+
Description: 'Use `match?` instead of `Regexp#match`, `String#match`, `Symbol#match`, `Regexp#===` or `=~` when `MatchData` is not used.'
|
1413
|
+
Enabled: true
|
1414
|
+
|
1415
|
+
Performance/ReverseEach:
|
1416
|
+
Description: 'Use `reverse_each` instead of `reverse.each`.'
|
1417
|
+
Reference: 'https://github.com/JuanitoFatas/fast-ruby#enumerablereverseeach-vs-enumerablereverse_each-code'
|
1418
|
+
Enabled: true
|
1419
|
+
|
1420
|
+
Performance/Sample:
|
1421
|
+
Description: >-
|
1422
|
+
Use `sample` instead of `shuffle.first`,
|
1423
|
+
`shuffle.last`, and `shuffle[Integer]`.
|
1424
|
+
Reference: 'https://github.com/JuanitoFatas/fast-ruby#arrayshufflefirst-vs-arraysample-code'
|
1425
|
+
Enabled: true
|
1426
|
+
|
1427
|
+
Performance/Size:
|
1428
|
+
Description: >-
|
1429
|
+
Use `size` instead of `count` for counting
|
1430
|
+
the number of elements in `Array` and `Hash`.
|
1431
|
+
Reference: 'https://github.com/JuanitoFatas/fast-ruby#arraycount-vs-arraysize-code'
|
1432
|
+
Enabled: true
|
1433
|
+
|
1434
|
+
Performance/CompareWithBlock:
|
1435
|
+
Description: 'Use `sort_by(&:foo)` instead of `sort_by { |a, b| a.foo <=> b.foo }`.'
|
1436
|
+
Enabled: true
|
1437
|
+
|
1438
|
+
Performance/StartWith:
|
1439
|
+
Description: 'Use `start_with?` instead of a regex match anchored to the beginning of a string.'
|
1440
|
+
Reference: 'https://github.com/JuanitoFatas/fast-ruby#stringmatch-vs-stringstart_withstringend_with-code-start-code-end'
|
1441
|
+
# This will change to a new method call which isn't guaranteed to be on the
|
1442
|
+
# object. Switching these methods has to be done with knowledge of the types
|
1443
|
+
# of the variables which rubocop doesn't have.
|
1444
|
+
AutoCorrect: false
|
1445
|
+
Enabled: true
|
1446
|
+
|
1447
|
+
Performance/StringReplacement:
|
1448
|
+
Description: >-
|
1449
|
+
Use `tr` instead of `gsub` when you are replacing the same
|
1450
|
+
number of characters. Use `delete` instead of `gsub` when
|
1451
|
+
you are deleting characters.
|
1452
|
+
Reference: 'https://github.com/JuanitoFatas/fast-ruby#stringgsub-vs-stringtr-code'
|
1453
|
+
Enabled: true
|
1454
|
+
|
1455
|
+
Performance/TimesMap:
|
1456
|
+
Description: 'Checks for .times.map calls.'
|
1457
|
+
Enabled: true
|
1458
|
+
|
1459
|
+
##################### Rails ##################################
|
1460
|
+
|
1461
|
+
Rails/ActionFilter:
|
1462
|
+
Description: 'Enforces consistent use of action filter methods.'
|
1463
|
+
Enabled: true
|
1464
|
+
|
1465
|
+
Rails/Date:
|
1466
|
+
Description: >-
|
1467
|
+
Checks the correct usage of date aware methods,
|
1468
|
+
such as Date.today, Date.current etc.
|
1469
|
+
Enabled: true
|
1470
|
+
|
1471
|
+
Rails/Delegate:
|
1472
|
+
Description: 'Prefer delegate method for delegations.'
|
1473
|
+
Enabled: true
|
1474
|
+
|
1475
|
+
Rails/DelegateAllowBlank:
|
1476
|
+
Description: 'Do not use allow_blank as an option to delegate.'
|
1477
|
+
Enabled: true
|
1478
|
+
|
1479
|
+
Rails/DynamicFindBy:
|
1480
|
+
Description: 'Use `find_by` instead of dynamic `find_by_*`.'
|
1481
|
+
StyleGuide: 'https://github.com/bbatsov/rails-style-guide#find_by'
|
1482
|
+
Enabled: true
|
1483
|
+
|
1484
|
+
Rails/EnumUniqueness:
|
1485
|
+
Description: 'Avoid duplicate integers in hash-syntax `enum` declaration.'
|
1486
|
+
Enabled: true
|
1487
|
+
|
1488
|
+
Rails/Exit:
|
1489
|
+
Description: >-
|
1490
|
+
Favor `fail`, `break`, `return`, etc. over `exit` in
|
1491
|
+
application or library code outside of Rake files to avoid
|
1492
|
+
exits during unit testing or running in production.
|
1493
|
+
Enabled: true
|
1494
|
+
|
1495
|
+
Rails/FilePath:
|
1496
|
+
Description: 'Use `Rails.root.join` for file path joining.'
|
1497
|
+
Enabled: true
|
1498
|
+
|
1499
|
+
Rails/FindBy:
|
1500
|
+
Description: 'Prefer find_by over where.first.'
|
1501
|
+
StyleGuide: 'https://github.com/bbatsov/rails-style-guide#find_by'
|
1502
|
+
Enabled: true
|
1503
|
+
|
1504
|
+
Rails/FindEach:
|
1505
|
+
Description: 'Prefer all.find_each over all.find.'
|
1506
|
+
StyleGuide: 'https://github.com/bbatsov/rails-style-guide#find-each'
|
1507
|
+
Enabled: true
|
1508
|
+
|
1509
|
+
Rails/HasAndBelongsToMany:
|
1510
|
+
Description: 'Prefer has_many :through to has_and_belongs_to_many.'
|
1511
|
+
StyleGuide: 'https://github.com/bbatsov/rails-style-guide#has-many-through'
|
1512
|
+
Enabled: true
|
1513
|
+
|
1514
|
+
Rails/HttpPositionalArguments:
|
1515
|
+
Description: 'Use keyword arguments instead of positional arguments in http method calls.'
|
1516
|
+
Enabled: true
|
1517
|
+
Include:
|
1518
|
+
- 'spec/**/*'
|
1519
|
+
- 'test/**/*'
|
1520
|
+
|
1521
|
+
Rails/NotNullColumn:
|
1522
|
+
Description: 'Do not add a NOT NULL column without a default value'
|
1523
|
+
Enabled: true
|
1524
|
+
|
1525
|
+
Rails/Output:
|
1526
|
+
Description: 'Checks for calls to puts, print, etc.'
|
1527
|
+
Enabled: true
|
1528
|
+
|
1529
|
+
Rails/OutputSafety:
|
1530
|
+
Description: 'The use of `html_safe` or `raw` may be a security risk.'
|
1531
|
+
Enabled: true
|
1532
|
+
|
1533
|
+
Rails/PluralizationGrammar:
|
1534
|
+
Description: 'Checks for incorrect grammar when using methods like `3.day.ago`.'
|
1535
|
+
Enabled: true
|
1536
|
+
|
1537
|
+
Rails/ReadWriteAttribute:
|
1538
|
+
Description: >-
|
1539
|
+
Checks for read_attribute(:attr) and
|
1540
|
+
write_attribute(:attr, val).
|
1541
|
+
StyleGuide: 'https://github.com/bbatsov/rails-style-guide#read-attribute'
|
1542
|
+
Enabled: true
|
1543
|
+
|
1544
|
+
Rails/RequestReferer:
|
1545
|
+
Description: 'Use consistent syntax for request.referer.'
|
1546
|
+
Enabled: true
|
1547
|
+
|
1548
|
+
Rails/SafeNavigation:
|
1549
|
+
Description: "Use Ruby's safe navigation operator (`&.`) instead of `try!`"
|
1550
|
+
Enabled: true
|
1551
|
+
|
1552
|
+
Rails/ScopeArgs:
|
1553
|
+
Description: 'Checks the arguments of ActiveRecord scopes.'
|
1554
|
+
Enabled: true
|
1555
|
+
|
1556
|
+
Rails/TimeZone:
|
1557
|
+
Description: 'Checks the correct usage of time zone aware methods.'
|
1558
|
+
StyleGuide: 'https://github.com/bbatsov/rails-style-guide#time'
|
1559
|
+
Reference: 'http://danilenko.org/2012/7/6/rails_timezones'
|
1560
|
+
Enabled: true
|
1561
|
+
|
1562
|
+
Rails/UniqBeforePluck:
|
1563
|
+
Description: 'Prefer the use of uniq or distinct before pluck.'
|
1564
|
+
Enabled: true
|
1565
|
+
|
1566
|
+
Rails/Validation:
|
1567
|
+
Description: 'Use validates :attribute, hash of validations.'
|
1568
|
+
Enabled: true
|
1569
|
+
|
1570
|
+
Security/Eval:
|
1571
|
+
Description: 'The use of eval represents a serious security risk.'
|
1572
|
+
Enabled: true
|
1573
|
+
|
1574
|
+
Security/JSONLoad:
|
1575
|
+
Description: >-
|
1576
|
+
Prefer usage of `JSON.parse` over `JSON.load` due to potential
|
1577
|
+
security issues. See reference for more information.
|
1578
|
+
Reference: 'http://ruby-doc.org/stdlib-2.3.0/libdoc/json/rdoc/JSON.html#method-i-load'
|
1579
|
+
Enabled: true
|
1580
|
+
# Autocorrect here will change to a method that may cause crashes depending
|
1581
|
+
# on the value of the argument.
|
1582
|
+
AutoCorrect: false
|
1583
|
+
|
1584
|
+
Security/MarshalLoad:
|
1585
|
+
Description: >-
|
1586
|
+
Avoid using of `Marshal.load` or `Marshal.restore` due to potential
|
1587
|
+
security issues. See reference for more information.
|
1588
|
+
Reference: 'http://ruby-doc.org/core-2.3.3/Marshal.html#module-Marshal-label-Security+considerations'
|
1589
|
+
Enabled: true
|
1590
|
+
|
1591
|
+
Security/YAMLLoad:
|
1592
|
+
Description: >-
|
1593
|
+
Prefer usage of `YAML.safe_load` over `YAML.load` due to potential
|
1594
|
+
security issues. See reference for more information.
|
1595
|
+
Reference: 'https://ruby-doc.org/stdlib-2.3.3/libdoc/yaml/rdoc/YAML.html#module-YAML-label-Security'
|
1596
|
+
Enabled: true
|
1597
|
+
|
1598
|
+
##################### Bundler #############################
|
1599
|
+
|
1600
|
+
Bundler/DuplicatedGem:
|
1601
|
+
Description: 'Checks for duplicate gem entries in Gemfile.'
|
1602
|
+
Enabled: true
|
1603
|
+
Include:
|
1604
|
+
- '**/Gemfile'
|
1605
|
+
- '**/gems.rb'
|
1606
|
+
|
1607
|
+
Bundler/OrderedGems:
|
1608
|
+
Description: >-
|
1609
|
+
Sort alphabetically gems appearing within a contiguous set
|
1610
|
+
of lines in the Gemfile
|
1611
|
+
Enabled: true
|
1612
|
+
Include:
|
1613
|
+
- '**/Gemfile'
|
1614
|
+
- '**/gems.rb'
|