art-rubocop 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +4 -0
- data/Gemfile.lock +67 -0
- data/LICENSE +674 -0
- data/PUBLISHING.md +9 -0
- data/README.md +63 -0
- data/Rakefile +1 -0
- data/art-rubocop.gemspec +25 -0
- data/default.yml +1339 -0
- data/pkg/art-rubocop-1.0.1.gem +0 -0
- metadata +13 -3
data/default.yml
ADDED
@@ -0,0 +1,1339 @@
|
|
1
|
+
require:
|
2
|
+
- rubocop-performance
|
3
|
+
- rubocop-rails
|
4
|
+
- rubocop-rspec
|
5
|
+
|
6
|
+
AllCops:
|
7
|
+
DisplayCopNames: true
|
8
|
+
NewCops: enable
|
9
|
+
RubyInterpreters:
|
10
|
+
- ruby
|
11
|
+
Include:
|
12
|
+
- '**/*.rb'
|
13
|
+
- '**/*.rake'
|
14
|
+
- '**/*.ru'
|
15
|
+
- '**/Gemfile'
|
16
|
+
- '**/Rakefile'
|
17
|
+
Exclude:
|
18
|
+
- 'app/javascript/**'
|
19
|
+
- 'db/schema.rb'
|
20
|
+
- 'node_modules/**/*'
|
21
|
+
- 'tmp/**/*'
|
22
|
+
- 'vendor/**/*'
|
23
|
+
- '.git/**/*'
|
24
|
+
- node_modules/**/*
|
25
|
+
- tmp/**/*
|
26
|
+
- vendor/**/*
|
27
|
+
- .git/**/*
|
28
|
+
TargetRubyVersion: 2.6
|
29
|
+
|
30
|
+
#################### Layout ###########################
|
31
|
+
|
32
|
+
Layout/ArgumentAlignment:
|
33
|
+
Description: 'Here we check if the parameters on a multi-line method call or definition are aligned.'
|
34
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-double-indent'
|
35
|
+
Enabled: false
|
36
|
+
|
37
|
+
Layout/HashAlignment:
|
38
|
+
Description: 'Here we check if the keys of a hash are properly aligned'
|
39
|
+
Enabled: true
|
40
|
+
EnforcedLastArgumentHashStyle: ignore_implicit
|
41
|
+
|
42
|
+
Layout/ConditionPosition:
|
43
|
+
Description: >-
|
44
|
+
Checks for condition placed in a confusing position relative to
|
45
|
+
the keyword.
|
46
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#same-line-condition'
|
47
|
+
Enabled: false
|
48
|
+
|
49
|
+
Layout/DotPosition:
|
50
|
+
Description: 'Checks the position of the dot in multi-line method calls.'
|
51
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#consistent-multi-line-chains'
|
52
|
+
EnforcedStyle: trailing
|
53
|
+
|
54
|
+
Layout/EmptyLinesAroundAttributeAccessor:
|
55
|
+
Description: "Keep blank lines around attribute accessors."
|
56
|
+
StyleGuide: '#empty-lines-around-attribute-accessor'
|
57
|
+
Enabled: true
|
58
|
+
AllowAliasSyntax: false
|
59
|
+
|
60
|
+
Layout/ExtraSpacing:
|
61
|
+
Description: 'Do not use unnecessary spacing.'
|
62
|
+
Enabled: true
|
63
|
+
|
64
|
+
Layout/LineLength:
|
65
|
+
Description: 'Limit lines to 100 characters.'
|
66
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#80-character-limits'
|
67
|
+
Max: 100
|
68
|
+
Exclude:
|
69
|
+
- config/environments/**/*
|
70
|
+
- config/initializers/**/*
|
71
|
+
- db/migrate/*.rb
|
72
|
+
- db/seeds/*.rb
|
73
|
+
- lib/tasks/**/*.rake
|
74
|
+
- spec/**/*.rb
|
75
|
+
|
76
|
+
Layout/MultilineOperationIndentation:
|
77
|
+
Description: >-
|
78
|
+
Checks indentation of binary operations that span more than
|
79
|
+
one line.
|
80
|
+
Enabled: true
|
81
|
+
EnforcedStyle: indented
|
82
|
+
|
83
|
+
Layout/MultilineMethodCallIndentation:
|
84
|
+
Description: >-
|
85
|
+
Checks indentation of method calls with the dot operator
|
86
|
+
that span more than one line.
|
87
|
+
Enabled: true
|
88
|
+
EnforcedStyle: indented
|
89
|
+
|
90
|
+
Layout/IndentationConsistency:
|
91
|
+
Description: >-
|
92
|
+
Checks for inconsistent indentation.
|
93
|
+
Enabled: true
|
94
|
+
EnforcedStyle: normal
|
95
|
+
|
96
|
+
Layout/IndentationWidth:
|
97
|
+
Description: >-
|
98
|
+
Checks for indentation that doesn't use the specified number of spaces.
|
99
|
+
Enabled: true
|
100
|
+
Width: 2
|
101
|
+
|
102
|
+
Layout/InitialIndentation:
|
103
|
+
Description: >-
|
104
|
+
Checks the indentation of the first non-blank non-comment line in a file.
|
105
|
+
Enabled: false
|
106
|
+
|
107
|
+
Layout/SpaceAroundMethodCallOperator:
|
108
|
+
Description: 'Checks method call operators to not have spaces around them.'
|
109
|
+
Enabled: true
|
110
|
+
|
111
|
+
##################### Lint ###########################
|
112
|
+
|
113
|
+
Lint/AmbiguousOperator:
|
114
|
+
Description: >-
|
115
|
+
Checks for ambiguous operators in the first argument of a
|
116
|
+
method invocation without parentheses.
|
117
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#parens-as-args'
|
118
|
+
Enabled: false
|
119
|
+
|
120
|
+
Lint/AmbiguousRegexpLiteral:
|
121
|
+
Description: >-
|
122
|
+
Checks for ambiguous regexp literals in the first argument of
|
123
|
+
a method invocation without parenthesis.
|
124
|
+
Enabled: false
|
125
|
+
|
126
|
+
Lint/AssignmentInCondition:
|
127
|
+
Description: "Don't use assignment in conditions."
|
128
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#safe-assignment-in-condition'
|
129
|
+
Enabled: false
|
130
|
+
|
131
|
+
Lint/CircularArgumentReference:
|
132
|
+
Description: "Don't refer to the keyword argument in the default value."
|
133
|
+
Enabled: false
|
134
|
+
|
135
|
+
Lint/DeprecatedClassMethods:
|
136
|
+
Description: 'Check for deprecated class method calls.'
|
137
|
+
Enabled: false
|
138
|
+
|
139
|
+
Lint/DeprecatedOpenSSLConstant:
|
140
|
+
Description: "Don't use algorithm constants for `OpenSSL::Cipher` and `OpenSSL::Digest`."
|
141
|
+
Enabled: true
|
142
|
+
|
143
|
+
Lint/MixedRegexpCaptureTypes:
|
144
|
+
Description: 'Do not mix named captures and numbered captures in a Regexp literal.'
|
145
|
+
Enabled: true
|
146
|
+
|
147
|
+
Lint/DuplicateHashKey:
|
148
|
+
Description: 'Check for duplicate keys in hash literals.'
|
149
|
+
Enabled: false
|
150
|
+
|
151
|
+
Lint/EachWithObjectArgument:
|
152
|
+
Description: 'Check for immutable argument given to each_with_object.'
|
153
|
+
Enabled: false
|
154
|
+
|
155
|
+
Lint/ElseLayout:
|
156
|
+
Description: 'Check for odd code arrangement in an else block.'
|
157
|
+
Enabled: false
|
158
|
+
|
159
|
+
Lint/EmptyWhen:
|
160
|
+
Description: 'Avoid when branches without a body.'
|
161
|
+
Enabled: false
|
162
|
+
|
163
|
+
Lint/FormatParameterMismatch:
|
164
|
+
Description: 'The number of parameters to format/sprint must match the fields.'
|
165
|
+
Enabled: false
|
166
|
+
|
167
|
+
Lint/FlipFlop:
|
168
|
+
Description: 'Checks for flip flops'
|
169
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-flip-flops'
|
170
|
+
Enabled: false
|
171
|
+
|
172
|
+
Lint/SuppressedException:
|
173
|
+
Description: "Don't suppress exception."
|
174
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#dont-hide-exceptions'
|
175
|
+
Enabled: false
|
176
|
+
|
177
|
+
Lint/LiteralAsCondition:
|
178
|
+
Description: 'Checks of literals used in conditions.'
|
179
|
+
Enabled: false
|
180
|
+
|
181
|
+
Lint/LiteralInInterpolation:
|
182
|
+
Description: 'Checks for literals used in interpolation.'
|
183
|
+
Enabled: false
|
184
|
+
|
185
|
+
Lint/Loop:
|
186
|
+
Description: >-
|
187
|
+
Use Kernel#loop with break rather than begin/end/until or
|
188
|
+
begin/end/while for post-loop tests.
|
189
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#loop-with-break'
|
190
|
+
Enabled: false
|
191
|
+
|
192
|
+
Lint/NestedMethodDefinition:
|
193
|
+
Description: 'Do not use nested method definitions.'
|
194
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-methods'
|
195
|
+
Enabled: false
|
196
|
+
|
197
|
+
Lint/NonLocalExitFromIterator:
|
198
|
+
Description: 'Do not use return in iterator to cause non-local exit.'
|
199
|
+
Enabled: false
|
200
|
+
|
201
|
+
Lint/ParenthesesAsGroupedExpression:
|
202
|
+
Description: >-
|
203
|
+
Checks for method calls with a space before the opening
|
204
|
+
parenthesis.
|
205
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#parens-no-spaces'
|
206
|
+
Enabled: false
|
207
|
+
|
208
|
+
Lint/RaiseException:
|
209
|
+
Description: Checks for `raise` or `fail` statements which are raising `Exception` class.
|
210
|
+
StyleGuide: '#raise-exception'
|
211
|
+
Enabled: true
|
212
|
+
Safe: false
|
213
|
+
AllowedImplicitNamespaces:
|
214
|
+
- 'Gem'
|
215
|
+
|
216
|
+
Lint/RedundantCopDisableDirective:
|
217
|
+
Description: >-
|
218
|
+
Checks for rubocop:disable comments that can be removed.
|
219
|
+
Note: this cop is not disabled when disabling all cops.
|
220
|
+
It must be explicitly disabled.
|
221
|
+
Enabled: true
|
222
|
+
|
223
|
+
Lint/RequireParentheses:
|
224
|
+
Description: >-
|
225
|
+
Use parentheses in the method call to avoid confusion
|
226
|
+
about precedence.
|
227
|
+
Enabled: false
|
228
|
+
|
229
|
+
Lint/StructNewOverride:
|
230
|
+
Description: 'Disallow overriding the `Struct` built-in methods via `Struct.new`.'
|
231
|
+
Enabled: true
|
232
|
+
VersionAdded: '0.81'
|
233
|
+
|
234
|
+
Lint/UnderscorePrefixedVariableName:
|
235
|
+
Description: 'Do not use prefix `_` for a variable that is used.'
|
236
|
+
Enabled: false
|
237
|
+
|
238
|
+
Lint/Void:
|
239
|
+
Description: 'Possible use of operator/literal/variable in void context.'
|
240
|
+
Enabled: false
|
241
|
+
|
242
|
+
##################### Metrics ###########################
|
243
|
+
|
244
|
+
Metrics/AbcSize:
|
245
|
+
Description: >-
|
246
|
+
A calculated magnitude based on number of assignments,
|
247
|
+
branches, and conditions.
|
248
|
+
Enabled: false
|
249
|
+
|
250
|
+
Metrics/BlockLength:
|
251
|
+
CountComments: true # count full line comments?
|
252
|
+
Max: 25
|
253
|
+
IgnoredMethods: []
|
254
|
+
Exclude:
|
255
|
+
- "app/admin/**/*"
|
256
|
+
- "config/routes.rb"
|
257
|
+
- "config/environments/**/*"
|
258
|
+
- "config/initializers/**/*"
|
259
|
+
- "db/migrate/**/*.rb"
|
260
|
+
- "db/seeds/**/*.rb"
|
261
|
+
- "lib/tasks/**/*.rake"
|
262
|
+
- "spec/**/*"
|
263
|
+
|
264
|
+
Metrics/BlockNesting:
|
265
|
+
Description: 'Avoid excessive block nesting'
|
266
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#three-is-the-number-thou-shalt-count'
|
267
|
+
Enabled: false
|
268
|
+
|
269
|
+
Metrics/ClassLength:
|
270
|
+
Description: 'Avoid classes longer than 100 lines of code.'
|
271
|
+
Enabled: false
|
272
|
+
|
273
|
+
Metrics/CyclomaticComplexity:
|
274
|
+
Description: >-
|
275
|
+
A complexity metric that is strongly correlated to the number
|
276
|
+
of test cases needed to validate a method.
|
277
|
+
Enabled: false
|
278
|
+
|
279
|
+
Metrics/MethodLength:
|
280
|
+
Description: 'Avoid methods longer than 10 lines of code.'
|
281
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#short-methods'
|
282
|
+
Enabled: true
|
283
|
+
|
284
|
+
Metrics/ModuleLength:
|
285
|
+
Description: 'Avoid modules longer than 100 lines of code.'
|
286
|
+
Enabled: false
|
287
|
+
|
288
|
+
Metrics/ParameterLists:
|
289
|
+
Description: 'Avoid parameter lists longer than three or four parameters.'
|
290
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#too-many-params'
|
291
|
+
Enabled: false
|
292
|
+
|
293
|
+
##################### Naming ###########################
|
294
|
+
|
295
|
+
Naming/AsciiIdentifiers:
|
296
|
+
Description: 'Use only ascii symbols in identifiers.'
|
297
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#english-identifiers'
|
298
|
+
Enabled: false
|
299
|
+
|
300
|
+
Naming/AccessorMethodName:
|
301
|
+
Description: Check the naming of accessor methods for get_/set_.
|
302
|
+
Enabled: false
|
303
|
+
|
304
|
+
Naming/BinaryOperatorParameterName:
|
305
|
+
Description: 'When defining binary operators, name the argument other.'
|
306
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#other-arg'
|
307
|
+
Enabled: false
|
308
|
+
|
309
|
+
Naming/FileName:
|
310
|
+
Description: 'Use snake_case for source file names.'
|
311
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#snake-case-files'
|
312
|
+
Enabled: false
|
313
|
+
|
314
|
+
Naming/MemoizedInstanceVariableName:
|
315
|
+
Enabled: false
|
316
|
+
|
317
|
+
Naming/PredicateName:
|
318
|
+
Description: 'Check the names of predicate methods.'
|
319
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#bool-methods-qmark'
|
320
|
+
ForbiddenPrefixes:
|
321
|
+
- is_
|
322
|
+
Exclude:
|
323
|
+
- spec/**/*
|
324
|
+
|
325
|
+
Naming/RescuedExceptionsVariableName:
|
326
|
+
Description: Check that rescued exceptions variables are named as expecte
|
327
|
+
Enabled: true
|
328
|
+
PreferredName: exception
|
329
|
+
|
330
|
+
Naming/VariableName:
|
331
|
+
Enabled: true
|
332
|
+
Exclude:
|
333
|
+
- app/views/**/*
|
334
|
+
|
335
|
+
##################### Style ###########################
|
336
|
+
|
337
|
+
Style/Alias:
|
338
|
+
Description: 'Use alias_method instead of alias.'
|
339
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#alias-method'
|
340
|
+
Enabled: false
|
341
|
+
|
342
|
+
Style/AndOr:
|
343
|
+
Enabled: true
|
344
|
+
Exclude:
|
345
|
+
- app/controllers/**/*.rb
|
346
|
+
|
347
|
+
Style/ArrayJoin:
|
348
|
+
Description: 'Use Array#join instead of Array#*.'
|
349
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#array-join'
|
350
|
+
Enabled: false
|
351
|
+
|
352
|
+
Style/AsciiComments:
|
353
|
+
Description: 'Use only ascii symbols in comments.'
|
354
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#english-comments'
|
355
|
+
Enabled: false
|
356
|
+
|
357
|
+
Style/Attr:
|
358
|
+
Description: 'Checks for uses of Module#attr.'
|
359
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#attr'
|
360
|
+
Enabled: false
|
361
|
+
|
362
|
+
Style/CaseEquality:
|
363
|
+
Description: 'Avoid explicit use of the case equality operator(===).'
|
364
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-case-equality'
|
365
|
+
Enabled: true
|
366
|
+
|
367
|
+
Style/CharacterLiteral:
|
368
|
+
Description: 'Checks for uses of character literals.'
|
369
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-character-literals'
|
370
|
+
Enabled: false
|
371
|
+
|
372
|
+
Style/ClassAndModuleChildren:
|
373
|
+
Description: 'Checks style of children classes and modules.'
|
374
|
+
Enabled: false
|
375
|
+
EnforcedStyle: nested
|
376
|
+
|
377
|
+
Style/ClassVars:
|
378
|
+
Description: 'Avoid the use of class variables.'
|
379
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-class-vars'
|
380
|
+
Enabled: true
|
381
|
+
|
382
|
+
Style/CollectionMethods:
|
383
|
+
Enabled: true
|
384
|
+
PreferredMethods:
|
385
|
+
find: detect
|
386
|
+
inject: reduce
|
387
|
+
collect: map
|
388
|
+
find_all: select
|
389
|
+
|
390
|
+
Style/HashAsLastArrayItem:
|
391
|
+
Enabled: true
|
392
|
+
StyleGuide: 'https://github.com/rubocop-hq/ruby-style-guide#hash-literal-as-last-array-item'
|
393
|
+
EnforcedStyle: no_braces
|
394
|
+
|
395
|
+
Style/ColonMethodCall:
|
396
|
+
Description: 'Do not use :: for method call.'
|
397
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#double-colons'
|
398
|
+
Enabled: false
|
399
|
+
|
400
|
+
Style/CommentAnnotation:
|
401
|
+
Description: >-
|
402
|
+
Checks formatting of special comments
|
403
|
+
(TODO, FIXME, OPTIMIZE, HACK, REVIEW).
|
404
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#annotate-keywords'
|
405
|
+
Enabled: false
|
406
|
+
|
407
|
+
Style/ConditionalAssignment:
|
408
|
+
Description: >-
|
409
|
+
Use the return of the conditional for variable assignment and
|
410
|
+
comparison.
|
411
|
+
Enabled: false
|
412
|
+
|
413
|
+
Style/Documentation:
|
414
|
+
Description: 'Document classes and non-namespace modules.'
|
415
|
+
Enabled: false
|
416
|
+
|
417
|
+
Style/DoubleNegation:
|
418
|
+
Description: 'Checks for uses of double negation (!!).'
|
419
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-bang-bang'
|
420
|
+
Enabled: false
|
421
|
+
|
422
|
+
Style/EachWithObject:
|
423
|
+
Description: 'Prefer `each_with_object` over `inject` or `reduce`.'
|
424
|
+
Enabled: true
|
425
|
+
|
426
|
+
Style/EmptyLiteral:
|
427
|
+
Description: 'Prefer literals to Array.new/Hash.new/String.new.'
|
428
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#literal-array-hash'
|
429
|
+
Enabled: true
|
430
|
+
|
431
|
+
Style/EmptyMethod:
|
432
|
+
Description: 'Put empty methods on a single line.'
|
433
|
+
Enabled: true
|
434
|
+
|
435
|
+
# Checks whether the source file has a utf-8 encoding comment or not
|
436
|
+
# AutoCorrectEncodingComment must match the regex
|
437
|
+
# /#.*coding\s?[:=]\s?(?:UTF|utf)-8/
|
438
|
+
Style/Encoding:
|
439
|
+
Enabled: false
|
440
|
+
|
441
|
+
Style/EvenOdd:
|
442
|
+
Description: 'Favor the use of Fixnum#even? && Fixnum#odd?'
|
443
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#predicate-methods'
|
444
|
+
Enabled: true
|
445
|
+
|
446
|
+
Style/ExponentialNotation:
|
447
|
+
Description: 'When using exponential notation, favor a mantissa between 1 (inclusive) and 10 (exclusive).'
|
448
|
+
StyleGuide: '#exponential-notation'
|
449
|
+
Enabled: true
|
450
|
+
VersionAdded: '0.82'
|
451
|
+
EnforcedStyle: scientific
|
452
|
+
SupportedStyles:
|
453
|
+
- scientific
|
454
|
+
- engineering
|
455
|
+
- integral
|
456
|
+
|
457
|
+
Style/FrozenStringLiteralComment:
|
458
|
+
Description: >-
|
459
|
+
Add the frozen_string_literal comment to the top of files
|
460
|
+
to help transition from Ruby 2.3.0 to Ruby 3.0.
|
461
|
+
Enabled: false
|
462
|
+
|
463
|
+
Style/FormatString:
|
464
|
+
Description: 'Enforce the use of Kernel#sprintf, Kernel#format or String#%.'
|
465
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#sprintf'
|
466
|
+
Enabled: false
|
467
|
+
|
468
|
+
Style/FormatStringToken:
|
469
|
+
Enabled: false
|
470
|
+
|
471
|
+
Style/GlobalVars:
|
472
|
+
Description: 'Do not introduce global variables.'
|
473
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#instance-vars'
|
474
|
+
Reference: 'http://www.zenspider.com/Languages/Ruby/QuickRef.html'
|
475
|
+
Enabled: false
|
476
|
+
|
477
|
+
Style/GuardClause:
|
478
|
+
Description: 'Check for conditionals that can be replaced with guard clauses'
|
479
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals'
|
480
|
+
Enabled: true
|
481
|
+
|
482
|
+
Style/HashEachMethods:
|
483
|
+
Description: 'Use Hash#each_key and Hash#each_value.'
|
484
|
+
StyleGuide: '#hash-each'
|
485
|
+
Enabled: true
|
486
|
+
VersionAdded: '0.80'
|
487
|
+
Safe: false
|
488
|
+
|
489
|
+
Style/HashTransformKeys:
|
490
|
+
Description: 'Prefer `transform_keys` over `each_with_object` and `map`.'
|
491
|
+
Enabled: true
|
492
|
+
VersionAdded: '0.80'
|
493
|
+
Safe: false
|
494
|
+
|
495
|
+
Style/HashTransformValues:
|
496
|
+
Description: 'Prefer `transform_values` over `each_with_object` and `map`.'
|
497
|
+
Enabled: true
|
498
|
+
VersionAdded: '0.80'
|
499
|
+
Safe: false
|
500
|
+
|
501
|
+
Style/IfUnlessModifier:
|
502
|
+
Description: >-
|
503
|
+
Favor modifier if/unless usage when you have a
|
504
|
+
single-line body.
|
505
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#if-as-a-modifier'
|
506
|
+
Enabled: true
|
507
|
+
|
508
|
+
Style/IfWithSemicolon:
|
509
|
+
Description: 'Do not use if x; .... Use the ternary operator instead.'
|
510
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-semicolon-ifs'
|
511
|
+
Enabled: false
|
512
|
+
|
513
|
+
Style/InlineComment:
|
514
|
+
Description: 'Avoid inline comments.'
|
515
|
+
Enabled: false
|
516
|
+
|
517
|
+
Style/Lambda:
|
518
|
+
Description: 'Use the new lambda literal syntax for single-line blocks.'
|
519
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#lambda-multi-line'
|
520
|
+
Enabled: true
|
521
|
+
|
522
|
+
Style/LambdaCall:
|
523
|
+
Description: 'Use lambda.call(...) instead of lambda.(...).'
|
524
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#proc-call'
|
525
|
+
Enabled: false
|
526
|
+
|
527
|
+
Style/LineEndConcatenation:
|
528
|
+
Description: >-
|
529
|
+
Use \ instead of + or << to concatenate two string literals at
|
530
|
+
line end.
|
531
|
+
Enabled: false
|
532
|
+
|
533
|
+
|
534
|
+
Style/PreferredHashMethods:
|
535
|
+
Description: 'Checks use of `has_key?` and `has_value?` Hash methods.'
|
536
|
+
StyleGuide: '#hash-key'
|
537
|
+
Enabled: false
|
538
|
+
|
539
|
+
Style/RedundantFetchBlock:
|
540
|
+
Description: >-
|
541
|
+
Use `fetch(key, value)` instead of `fetch(key) { value }`
|
542
|
+
when value has Numeric, Rational, Complex, Symbol or String type, `false`, `true`, `nil` or is a constant.
|
543
|
+
Reference: 'https://github.com/JuanitoFatas/fast-ruby#hashfetch-with-argument-vs-hashfetch--block-code'
|
544
|
+
Enabled: true
|
545
|
+
Safe: false
|
546
|
+
# If enabled, this cop will autocorrect usages of
|
547
|
+
# `fetch` being called with block returning a constant.
|
548
|
+
# This can be dangerous since constants will not be defined at that moment.
|
549
|
+
SafeForConstants: false
|
550
|
+
VersionAdded: '0.86'
|
551
|
+
|
552
|
+
Style/RedundantRegexpCharacterClass:
|
553
|
+
Description: 'Checks for unnecessary single-element Regexp character classes.'
|
554
|
+
Enabled: true
|
555
|
+
VersionAdded: '0.85'
|
556
|
+
|
557
|
+
Style/RedundantRegexpEscape:
|
558
|
+
Description: 'Checks for redundant escapes in Regexps.'
|
559
|
+
Enabled: true
|
560
|
+
VersionAdded: '0.85'
|
561
|
+
|
562
|
+
Style/SafeNavigation:
|
563
|
+
Description: >-
|
564
|
+
This cop transforms usages of a method call safeguarded by
|
565
|
+
a check for the existence of the object to
|
566
|
+
safe navigation (`&.`).
|
567
|
+
Enabled: false
|
568
|
+
VersionAdded: '0.43'
|
569
|
+
VersionChanged: '0.56'
|
570
|
+
# Safe navigation may cause a statement to start returning `nil` in addition
|
571
|
+
# to whatever it used to return.
|
572
|
+
ConvertCodeThatCanStartToReturnNil: false
|
573
|
+
AllowedMethods:
|
574
|
+
- present?
|
575
|
+
- blank?
|
576
|
+
- presence
|
577
|
+
- try
|
578
|
+
- try!
|
579
|
+
|
580
|
+
Style/SlicingWithRange:
|
581
|
+
Description: 'Checks array slicing is done with endless ranges when suitable.'
|
582
|
+
Enabled: true
|
583
|
+
VersionAdded: '0.83'
|
584
|
+
Safe: false
|
585
|
+
|
586
|
+
Style/SymbolProc:
|
587
|
+
Enabled: true
|
588
|
+
Exclude:
|
589
|
+
- config/initializers/**/*
|
590
|
+
|
591
|
+
Style/ModuleFunction:
|
592
|
+
Description: 'Checks for usage of `extend self` in modules.'
|
593
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#module-function'
|
594
|
+
Enabled: false
|
595
|
+
|
596
|
+
Style/MultilineBlockChain:
|
597
|
+
Description: 'Avoid multi-line chains of blocks.'
|
598
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#single-line-blocks'
|
599
|
+
Enabled: false
|
600
|
+
|
601
|
+
Style/NegatedIf:
|
602
|
+
Description: >-
|
603
|
+
Favor unless over if for negative conditions
|
604
|
+
(or control flow or).
|
605
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#unless-for-negatives'
|
606
|
+
Enabled: false
|
607
|
+
|
608
|
+
Style/NegatedWhile:
|
609
|
+
Description: 'Favor until over while for negative conditions.'
|
610
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#until-for-negatives'
|
611
|
+
Enabled: false
|
612
|
+
|
613
|
+
Style/Next:
|
614
|
+
Description: 'Use `next` to skip iteration instead of a condition at the end.'
|
615
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals'
|
616
|
+
Enabled: false
|
617
|
+
|
618
|
+
Style/NilComparison:
|
619
|
+
Description: 'Prefer x.nil? to x == nil.'
|
620
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#predicate-methods'
|
621
|
+
Enabled: false
|
622
|
+
|
623
|
+
Style/Not:
|
624
|
+
Description: 'Use ! instead of not.'
|
625
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#bang-not-not'
|
626
|
+
Enabled: false
|
627
|
+
|
628
|
+
Style/NumericLiterals:
|
629
|
+
Description: >-
|
630
|
+
Add underscores to large numeric literals to improve their
|
631
|
+
readability.
|
632
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#underscores-in-numerics'
|
633
|
+
Enabled: false
|
634
|
+
|
635
|
+
Style/OneLineConditional:
|
636
|
+
Description: >-
|
637
|
+
Favor the ternary operator(?:) over
|
638
|
+
if/then/else/end constructs.
|
639
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#ternary-operator'
|
640
|
+
Enabled: false
|
641
|
+
|
642
|
+
Style/IfInsideElse:
|
643
|
+
Enabled: false
|
644
|
+
|
645
|
+
Style/NumericPredicate:
|
646
|
+
Enabled: false
|
647
|
+
|
648
|
+
Style/PercentLiteralDelimiters:
|
649
|
+
Description: 'Use `%`-literal delimiters consistently'
|
650
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-literal-braces'
|
651
|
+
Enabled: false
|
652
|
+
|
653
|
+
Style/PerlBackrefs:
|
654
|
+
Description: 'Avoid Perl-style regex back references.'
|
655
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-perl-regexp-last-matchers'
|
656
|
+
Enabled: false
|
657
|
+
|
658
|
+
Style/Proc:
|
659
|
+
Description: 'Use proc instead of Proc.new.'
|
660
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#proc'
|
661
|
+
Enabled: false
|
662
|
+
|
663
|
+
Style/RaiseArgs:
|
664
|
+
Description: 'Checks the arguments passed to raise/fail.'
|
665
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#exception-class-messages'
|
666
|
+
Enabled: false
|
667
|
+
|
668
|
+
Style/RegexpLiteral:
|
669
|
+
Description: 'Use / or %r around regular expressions.'
|
670
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-r'
|
671
|
+
Enabled: false
|
672
|
+
|
673
|
+
Style/Sample:
|
674
|
+
Description: >-
|
675
|
+
Use `sample` instead of `shuffle.first`,
|
676
|
+
`shuffle.last`, and `shuffle[Fixnum]`.
|
677
|
+
Reference: 'https://github.com/JuanitoFatas/fast-ruby#arrayshufflefirst-vs-arraysample-code'
|
678
|
+
Enabled: true
|
679
|
+
|
680
|
+
Style/SelfAssignment:
|
681
|
+
Description: >-
|
682
|
+
Checks for places where self-assignment shorthand should have
|
683
|
+
been used.
|
684
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#self-assignment'
|
685
|
+
Enabled: false
|
686
|
+
|
687
|
+
Style/SingleLineBlockParams:
|
688
|
+
Description: 'Enforces the names of some block params.'
|
689
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#reduce-blocks'
|
690
|
+
Enabled: false
|
691
|
+
|
692
|
+
Style/SingleLineMethods:
|
693
|
+
Description: 'Avoid single-line methods.'
|
694
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-single-line-methods'
|
695
|
+
Enabled: false
|
696
|
+
|
697
|
+
Style/SignalException:
|
698
|
+
Description: 'Checks for proper usage of fail and raise.'
|
699
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#fail-method'
|
700
|
+
Enabled: true
|
701
|
+
|
702
|
+
Style/SpecialGlobalVars:
|
703
|
+
Description: 'Avoid Perl-style global variables.'
|
704
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-cryptic-perlisms'
|
705
|
+
Enabled: false
|
706
|
+
|
707
|
+
Style/StringLiterals:
|
708
|
+
Description: 'Checks if uses of quotes match the configured preference.'
|
709
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#consistent-string-literals'
|
710
|
+
EnforcedStyle: double_quotes
|
711
|
+
Enabled: true
|
712
|
+
Exclude:
|
713
|
+
- config/environment.rb
|
714
|
+
|
715
|
+
Style/TrailingCommaInArguments:
|
716
|
+
Description: 'Checks for trailing comma in argument lists.'
|
717
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
|
718
|
+
EnforcedStyleForMultiline: comma
|
719
|
+
SupportedStylesForMultiline:
|
720
|
+
- comma
|
721
|
+
- consistent_comma
|
722
|
+
- no_comma
|
723
|
+
Enabled: true
|
724
|
+
|
725
|
+
Style/TrailingCommaInArrayLiteral:
|
726
|
+
Description: 'Checks for trailing comma in array and hash literals.'
|
727
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
|
728
|
+
EnforcedStyleForMultiline: comma
|
729
|
+
SupportedStylesForMultiline:
|
730
|
+
- comma
|
731
|
+
- consistent_comma
|
732
|
+
- no_comma
|
733
|
+
Enabled: true
|
734
|
+
|
735
|
+
Style/TrailingCommaInHashLiteral:
|
736
|
+
Description: 'Checks for trailing comma in array and hash literals.'
|
737
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
|
738
|
+
EnforcedStyleForMultiline: comma
|
739
|
+
SupportedStylesForMultiline:
|
740
|
+
- comma
|
741
|
+
- consistent_comma
|
742
|
+
- no_comma
|
743
|
+
Enabled: true
|
744
|
+
|
745
|
+
Style/TrivialAccessors:
|
746
|
+
Description: 'Prefer attr_* methods to trivial readers/writers.'
|
747
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#attr_family'
|
748
|
+
Enabled: false
|
749
|
+
|
750
|
+
Style/VariableInterpolation:
|
751
|
+
Description: >-
|
752
|
+
Don't interpolate global, instance and class variables
|
753
|
+
directly in strings.
|
754
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#curlies-interpolate'
|
755
|
+
Enabled: false
|
756
|
+
|
757
|
+
Style/WhenThen:
|
758
|
+
Description: 'Use when x then ... for one-line cases.'
|
759
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#one-line-cases'
|
760
|
+
Enabled: false
|
761
|
+
|
762
|
+
Style/WhileUntilModifier:
|
763
|
+
Description: >-
|
764
|
+
Favor modifier while/until usage when you have a
|
765
|
+
single-line body.
|
766
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#while-as-a-modifier'
|
767
|
+
Enabled: false
|
768
|
+
|
769
|
+
Style/WordArray:
|
770
|
+
Description: 'Use %w or %W for arrays of words.'
|
771
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-w'
|
772
|
+
Enabled: false
|
773
|
+
|
774
|
+
# Performance
|
775
|
+
|
776
|
+
Performance/CaseWhenSplat:
|
777
|
+
Description: >-
|
778
|
+
Place `when` conditions that use splat at the end
|
779
|
+
of the list of `when` branches.
|
780
|
+
Enabled: true
|
781
|
+
|
782
|
+
Performance/Count:
|
783
|
+
Description: >-
|
784
|
+
Use `count` instead of `select...size`, `reject...size`,
|
785
|
+
`select...count`, `reject...count`, `select...length`,
|
786
|
+
and `reject...length`.
|
787
|
+
Enabled: true
|
788
|
+
|
789
|
+
Performance/Detect:
|
790
|
+
Description: >-
|
791
|
+
Use `detect` instead of `select.first`, `find_all.first`,
|
792
|
+
`select.last`, and `find_all.last`.
|
793
|
+
Reference: 'https://github.com/JuanitoFatas/fast-ruby#enumerabledetect-vs-enumerableselectfirst-code'
|
794
|
+
Enabled: true
|
795
|
+
|
796
|
+
Performance/FlatMap:
|
797
|
+
Description: >-
|
798
|
+
Use `Enumerable#flat_map`
|
799
|
+
instead of `Enumerable#map...Array#flatten(1)`
|
800
|
+
or `Enumberable#collect..Array#flatten(1)`
|
801
|
+
Reference: 'https://github.com/JuanitoFatas/fast-ruby#enumerablemaparrayflatten-vs-enumerableflat_map-code'
|
802
|
+
Enabled: true
|
803
|
+
|
804
|
+
Performance/ReverseEach:
|
805
|
+
Description: 'Use `reverse_each` instead of `reverse.each`.'
|
806
|
+
Reference: 'https://github.com/JuanitoFatas/fast-ruby#enumerablereverseeach-vs-enumerablereverse_each-code'
|
807
|
+
Enabled: true
|
808
|
+
|
809
|
+
Performance/Size:
|
810
|
+
Description: >-
|
811
|
+
Use `size` instead of `count` for counting
|
812
|
+
the number of elements in `Array` and `Hash`.
|
813
|
+
Reference: 'https://github.com/JuanitoFatas/fast-ruby#arraycount-vs-arraysize-code'
|
814
|
+
Enabled: true
|
815
|
+
|
816
|
+
Performance/StringReplacement:
|
817
|
+
Description: >-
|
818
|
+
Use `tr` instead of `gsub` when you are replacing the same
|
819
|
+
number of characters. Use `delete` instead of `gsub` when
|
820
|
+
you are deleting characters.
|
821
|
+
Reference: 'https://github.com/JuanitoFatas/fast-ruby#stringgsub-vs-stringtr-code'
|
822
|
+
Enabled: true
|
823
|
+
|
824
|
+
# Rails
|
825
|
+
|
826
|
+
Rails/ActionFilter:
|
827
|
+
Description: 'Enforces consistent use of action filter methods.'
|
828
|
+
Enabled: false
|
829
|
+
|
830
|
+
Rails/Date:
|
831
|
+
Description: >-
|
832
|
+
Checks the correct usage of date aware methods,
|
833
|
+
such as Date.today, Date.current etc.
|
834
|
+
Enabled: true
|
835
|
+
|
836
|
+
Rails/Delegate:
|
837
|
+
Description: 'Prefer delegate method for delegations.'
|
838
|
+
Enabled: false
|
839
|
+
|
840
|
+
Rails/DynamicFindBy:
|
841
|
+
Description: 'Prefer non-dynamic finder methods.'
|
842
|
+
Enabled: false
|
843
|
+
|
844
|
+
Rails/FindBy:
|
845
|
+
Description: 'Prefer find_by over where.first.'
|
846
|
+
Enabled: true
|
847
|
+
|
848
|
+
Rails/FindEach:
|
849
|
+
Description: 'Prefer all.find_each over all.find.'
|
850
|
+
Enabled: true
|
851
|
+
|
852
|
+
Rails/InverseOf:
|
853
|
+
Enabled: false
|
854
|
+
|
855
|
+
Rails/HasAndBelongsToMany:
|
856
|
+
Description: 'Prefer has_many :through to has_and_belongs_to_many.'
|
857
|
+
Enabled: false
|
858
|
+
|
859
|
+
Rails/HasManyOrHasOneDependent:
|
860
|
+
Description: 'Define the dependent option to the has_many and has_one associations.'
|
861
|
+
StyleGuide: 'https://rails.rubystyle.guide#has_many-has_one-dependent-option'
|
862
|
+
Enabled: false
|
863
|
+
VersionAdded: '0.50'
|
864
|
+
Include:
|
865
|
+
- app/models/**/*.rb
|
866
|
+
|
867
|
+
Rails/HttpStatus:
|
868
|
+
Description: Enforces use of symbolic or numeric value to describe HTTP status.
|
869
|
+
Enabled: true
|
870
|
+
EnforcedStyle: symbolic
|
871
|
+
SupportedStyles:
|
872
|
+
- numeric
|
873
|
+
- symbolic
|
874
|
+
StyleGuide: http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Rails/HttpStatus
|
875
|
+
|
876
|
+
Rails/Output:
|
877
|
+
Description: 'Checks for calls to puts, print, etc.'
|
878
|
+
Enabled: true
|
879
|
+
|
880
|
+
Rails/ReadWriteAttribute:
|
881
|
+
Description: >-
|
882
|
+
Checks for read_attribute(:attr) and
|
883
|
+
write_attribute(:attr, val).
|
884
|
+
Enabled: false
|
885
|
+
|
886
|
+
Rails/ScopeArgs:
|
887
|
+
Description: 'Checks the arguments of ActiveRecord scopes.'
|
888
|
+
Enabled: false
|
889
|
+
|
890
|
+
Rails/SkipsModelValidations:
|
891
|
+
Description: 'Checks for the use of ActiveRecord persistence methods that bypass model validations'
|
892
|
+
Enabled: true
|
893
|
+
|
894
|
+
Rails/TimeZone:
|
895
|
+
Description: 'Checks the correct usage of time zone aware methods.'
|
896
|
+
StyleGuide: 'https://github.com/bbatsov/rails-style-guide#time'
|
897
|
+
Reference: 'http://danilenko.org/2012/7/6/rails_timezones'
|
898
|
+
Enabled: false
|
899
|
+
|
900
|
+
Rails/Validation:
|
901
|
+
Description: 'Use validates :attribute, hash of validations.'
|
902
|
+
Enabled: false
|
903
|
+
|
904
|
+
RSpec/Capybara/CurrentPathExpectation:
|
905
|
+
Description: Checks that no expectations are set on Capybara's `current_path`.
|
906
|
+
Enabled: true
|
907
|
+
StyleGuide: http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Capybara/CurrentPathExpectation
|
908
|
+
|
909
|
+
RSpec/Capybara/FeatureMethods:
|
910
|
+
Description: Checks for consistent method usage in feature specs.
|
911
|
+
Enabled: false
|
912
|
+
EnabledMethods: []
|
913
|
+
StyleGuide: http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Capybara/FeatureMethods
|
914
|
+
|
915
|
+
RSpec/FactoryBot/AttributeDefinedStatically:
|
916
|
+
Description: Always declare attribute values as blocks.
|
917
|
+
Enabled: true
|
918
|
+
StyleGuide: http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/FactoryBot/AttributeDefinedStatically
|
919
|
+
|
920
|
+
RSpec/FactoryBot/CreateList:
|
921
|
+
Description: Checks for create_list usage.
|
922
|
+
Enabled: false
|
923
|
+
EnforcedStyle: create_list
|
924
|
+
SupportedStyles:
|
925
|
+
- create_list
|
926
|
+
- n_times
|
927
|
+
StyleGuide: http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/FactoryBot/CreateList
|
928
|
+
|
929
|
+
# rubocop-rspec cops
|
930
|
+
|
931
|
+
RSpec/AnyInstance:
|
932
|
+
Description: Check that instances are not being stubbed globally.
|
933
|
+
Enabled: true
|
934
|
+
StyleGuide: http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/AnyInstance
|
935
|
+
|
936
|
+
RSpec/AroundBlock:
|
937
|
+
Description: Checks that around blocks actually run the test.
|
938
|
+
Enabled: true
|
939
|
+
StyleGuide: http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/AroundBlock
|
940
|
+
|
941
|
+
RSpec/AlignLeftLetBrace:
|
942
|
+
Description: Checks that left braces for adjacent single line lets are aligned.
|
943
|
+
Enabled: false
|
944
|
+
StyleGuide: http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/AlignLeftLetBrace
|
945
|
+
|
946
|
+
RSpec/AlignRightLetBrace:
|
947
|
+
Description: Checks that right braces for adjacent single line lets are aligned.
|
948
|
+
Enabled: false
|
949
|
+
StyleGuide: http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/AlignRightLetBrace
|
950
|
+
|
951
|
+
RSpec/Be:
|
952
|
+
Description: Check for expectations where `be` is used without argument.
|
953
|
+
Enabled: true
|
954
|
+
StyleGuide: http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Be
|
955
|
+
|
956
|
+
RSpec/BeEql:
|
957
|
+
Description: Check for expectations where `be(...)` can replace `eql(...)`.
|
958
|
+
Enabled: true
|
959
|
+
StyleGuide: http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/BeEql
|
960
|
+
|
961
|
+
RSpec/BeforeAfterAll:
|
962
|
+
Description: Check that before/after(:all) isn't being used.
|
963
|
+
Enabled: true
|
964
|
+
Exclude:
|
965
|
+
- spec/spec_helper.rb
|
966
|
+
- spec/rails_helper.rb
|
967
|
+
- spec/support/**/*.rb
|
968
|
+
StyleGuide: http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/BeforeAfterAll
|
969
|
+
|
970
|
+
RSpec/ContextWording:
|
971
|
+
Description: "`context` block descriptions should start with 'when', or 'with'."
|
972
|
+
Enabled: false
|
973
|
+
Prefixes:
|
974
|
+
- when
|
975
|
+
- with
|
976
|
+
- without
|
977
|
+
StyleGuide: http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ContextWording
|
978
|
+
|
979
|
+
RSpec/DescribeClass:
|
980
|
+
Description: Check that the first argument to the top level describe is a constant.
|
981
|
+
Enabled: false
|
982
|
+
StyleGuide: http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/DescribeClass
|
983
|
+
|
984
|
+
RSpec/DescribedClass:
|
985
|
+
Description: Checks that tests use `described_class`.
|
986
|
+
SkipBlocks: false
|
987
|
+
Enabled: false
|
988
|
+
EnforcedStyle: described_class
|
989
|
+
SupportedStyles:
|
990
|
+
- described_class
|
991
|
+
- explicit
|
992
|
+
StyleGuide: http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/DescribedClass
|
993
|
+
|
994
|
+
RSpec/DescribeMethod:
|
995
|
+
Description: Checks that the second argument to `describe` specifies a method.
|
996
|
+
Enabled: false
|
997
|
+
StyleGuide: http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/DescribeMethod
|
998
|
+
|
999
|
+
RSpec/DescribeSymbol:
|
1000
|
+
Description: Avoid describing symbols.
|
1001
|
+
Enabled: true
|
1002
|
+
StyleGuide: http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/DescribeSymbol
|
1003
|
+
|
1004
|
+
RSpec/IteratedExpectation:
|
1005
|
+
Description: Check that `all` matcher is used instead of iterating over an array.
|
1006
|
+
Enabled: true
|
1007
|
+
StyleGuide: http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/IteratedExpectation
|
1008
|
+
|
1009
|
+
RSpec/EmptyExampleGroup:
|
1010
|
+
Description: Checks if an example group does not include any tests.
|
1011
|
+
Enabled: true
|
1012
|
+
StyleGuide: http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/EmptyExampleGroup
|
1013
|
+
|
1014
|
+
RSpec/EmptyLineAfterExampleGroup:
|
1015
|
+
Description: Checks if there is an empty line after example group blocks.
|
1016
|
+
Enabled: true
|
1017
|
+
StyleGuide: http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/EmptyLineAfterExampleGroup
|
1018
|
+
|
1019
|
+
RSpec/EmptyLineAfterFinalLet:
|
1020
|
+
Description: Checks if there is an empty line after the last let block.
|
1021
|
+
Enabled: true
|
1022
|
+
StyleGuide: http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/EmptyLineAfterFinalLet
|
1023
|
+
|
1024
|
+
RSpec/EmptyLineAfterHook:
|
1025
|
+
Description: Checks if there is an empty line after hook blocks.
|
1026
|
+
Enabled: true
|
1027
|
+
StyleGuide: http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/EmptyLineAfterHook
|
1028
|
+
|
1029
|
+
RSpec/EmptyLineAfterSubject:
|
1030
|
+
Description: Checks if there is an empty line after subject block.
|
1031
|
+
Enabled: true
|
1032
|
+
StyleGuide: http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/EmptyLineAfterSubject
|
1033
|
+
|
1034
|
+
RSpec/ExampleLength:
|
1035
|
+
Description: Checks for long examples.
|
1036
|
+
Enabled: false
|
1037
|
+
Max: 5
|
1038
|
+
StyleGuide: http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ExampleLength
|
1039
|
+
|
1040
|
+
RSpec/ExampleWithoutDescription:
|
1041
|
+
Description: Checks for examples without a description.
|
1042
|
+
Enabled: true
|
1043
|
+
EnforcedStyle: always_allow
|
1044
|
+
SupportedStyles:
|
1045
|
+
- always_allow
|
1046
|
+
- single_line_only
|
1047
|
+
- disallow
|
1048
|
+
StyleGuide: http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ExampleWithoutDescription
|
1049
|
+
|
1050
|
+
RSpec/ExampleWording:
|
1051
|
+
Description: Checks for common mistakes in example descriptions.
|
1052
|
+
Enabled: true
|
1053
|
+
CustomTransform:
|
1054
|
+
be: is
|
1055
|
+
BE: IS
|
1056
|
+
have: has
|
1057
|
+
HAVE: HAS
|
1058
|
+
IgnoredWords: []
|
1059
|
+
StyleGuide: http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ExampleWording
|
1060
|
+
|
1061
|
+
RSpec/ExpectActual:
|
1062
|
+
Description: Checks for `expect(...)` calls containing literal values.
|
1063
|
+
Enabled: true
|
1064
|
+
Exclude:
|
1065
|
+
- spec/routing/**/*
|
1066
|
+
StyleGuide: http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ExpectActual
|
1067
|
+
|
1068
|
+
RSpec/ExpectChange:
|
1069
|
+
Description: Checks for consistent style of change matcher.
|
1070
|
+
Enabled: true
|
1071
|
+
EnforcedStyle: method_call
|
1072
|
+
SupportedStyles:
|
1073
|
+
- method_call
|
1074
|
+
- block
|
1075
|
+
StyleGuide: http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ExpectChange
|
1076
|
+
|
1077
|
+
RSpec/ExpectInHook:
|
1078
|
+
Enabled: true
|
1079
|
+
Description: Do not use `expect` in hooks such as `before`.
|
1080
|
+
StyleGuide: http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ExpectInHook
|
1081
|
+
|
1082
|
+
RSpec/ExpectOutput:
|
1083
|
+
Description: Checks for opportunities to use `expect { ... }.to output`.
|
1084
|
+
Enabled: true
|
1085
|
+
StyleGuide: http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ExpectOutput
|
1086
|
+
|
1087
|
+
RSpec/FilePath:
|
1088
|
+
Description: Checks that spec file paths are consistent with the test subject.
|
1089
|
+
Enabled: true
|
1090
|
+
CustomTransform:
|
1091
|
+
RuboCop: rubocop
|
1092
|
+
RSpec: rspec
|
1093
|
+
IgnoreMethods: false
|
1094
|
+
StyleGuide: http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/FilePath
|
1095
|
+
|
1096
|
+
RSpec/Focus:
|
1097
|
+
Description: Checks if examples are focused.
|
1098
|
+
Enabled: true
|
1099
|
+
StyleGuide: http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Focus
|
1100
|
+
|
1101
|
+
RSpec/HookArgument:
|
1102
|
+
Description: Checks the arguments passed to `before`, `around`, and `after`.
|
1103
|
+
Enabled: true
|
1104
|
+
EnforcedStyle: implicit
|
1105
|
+
SupportedStyles:
|
1106
|
+
- implicit
|
1107
|
+
- each
|
1108
|
+
- example
|
1109
|
+
StyleGuide: http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/HookArgument
|
1110
|
+
|
1111
|
+
RSpec/HooksBeforeExamples:
|
1112
|
+
Enabled: true
|
1113
|
+
Description: Checks for before/around/after hooks that come after an example.
|
1114
|
+
StyleGuide: http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/HooksBeforeExamples
|
1115
|
+
|
1116
|
+
RSpec/ImplicitExpect:
|
1117
|
+
Description: Check that a consistent implicit expectation style is used.
|
1118
|
+
Enabled: true
|
1119
|
+
EnforcedStyle: is_expected
|
1120
|
+
SupportedStyles:
|
1121
|
+
- is_expected
|
1122
|
+
- should
|
1123
|
+
StyleGuide: http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ImplicitExpect
|
1124
|
+
|
1125
|
+
RSpec/ImplicitSubject:
|
1126
|
+
Enabled: false
|
1127
|
+
Exclude:
|
1128
|
+
- 'spec/controllers/**/*.rb'
|
1129
|
+
Description: Checks for usage of implicit subject (`is_expected` / `should`).
|
1130
|
+
EnforcedStyle: single_line_only
|
1131
|
+
SupportedStyles:
|
1132
|
+
- single_line_only
|
1133
|
+
- disallow
|
1134
|
+
StyleGuide: http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ImplicitSubject
|
1135
|
+
|
1136
|
+
RSpec/InstanceSpy:
|
1137
|
+
Description: Checks for `instance_double` used with `have_received`.
|
1138
|
+
Enabled: true
|
1139
|
+
StyleGuide: http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/InstanceSpy
|
1140
|
+
|
1141
|
+
RSpec/InstanceVariable:
|
1142
|
+
Description: Checks for instance variable usage in specs.
|
1143
|
+
AssignmentOnly: false
|
1144
|
+
Enabled: true
|
1145
|
+
StyleGuide: http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/InstanceVariable
|
1146
|
+
|
1147
|
+
RSpec/ItBehavesLike:
|
1148
|
+
Description: Checks that only one `it_behaves_like` style is used.
|
1149
|
+
Enabled: true
|
1150
|
+
EnforcedStyle: it_behaves_like
|
1151
|
+
SupportedStyles:
|
1152
|
+
- it_behaves_like
|
1153
|
+
- it_should_behave_like
|
1154
|
+
StyleGuide: http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ItBehavesLike
|
1155
|
+
|
1156
|
+
RSpec/LeadingSubject:
|
1157
|
+
Description: Enforce that subject is the first definition in the test.
|
1158
|
+
Enabled: true
|
1159
|
+
StyleGuide: http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/LeadingSubject
|
1160
|
+
|
1161
|
+
RSpec/LeakyConstantDeclaration:
|
1162
|
+
Description: Checks that no class, module, or constant is declared.
|
1163
|
+
Enabled: true
|
1164
|
+
StyleGuide: https://rubocop-rspec.readthedocs.io/en/latest/cops_rspec/#rspecleakyconstantdeclaration
|
1165
|
+
|
1166
|
+
RSpec/LetBeforeExamples:
|
1167
|
+
Description: Checks for `let` definitions that come after an example.
|
1168
|
+
Enabled: true
|
1169
|
+
StyleGuide: http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/LetBeforeExamples
|
1170
|
+
|
1171
|
+
RSpec/LetSetup:
|
1172
|
+
Description: Checks unreferenced `let!` calls being used for test setup.
|
1173
|
+
Enabled: true
|
1174
|
+
StyleGuide: http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/LetSetup
|
1175
|
+
|
1176
|
+
RSpec/MessageChain:
|
1177
|
+
Description: Check that chains of messages are not being stubbed.
|
1178
|
+
Enabled: true
|
1179
|
+
StyleGuide: http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/MessageChain
|
1180
|
+
|
1181
|
+
RSpec/MessageExpectation:
|
1182
|
+
Description: Checks for consistent message expectation style.
|
1183
|
+
Enabled: false
|
1184
|
+
EnforcedStyle: allow
|
1185
|
+
SupportedStyles:
|
1186
|
+
- allow
|
1187
|
+
- expect
|
1188
|
+
StyleGuide: http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/MessageExpectation
|
1189
|
+
|
1190
|
+
RSpec/MessageSpies:
|
1191
|
+
Description: Checks that message expectations are set using spies.
|
1192
|
+
Enabled: true
|
1193
|
+
EnforcedStyle: have_received
|
1194
|
+
SupportedStyles:
|
1195
|
+
- have_received
|
1196
|
+
- receive
|
1197
|
+
StyleGuide: http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/MessageSpies
|
1198
|
+
|
1199
|
+
RSpec/MissingExampleGroupArgument:
|
1200
|
+
Description: Checks that the first argument to an example group is not empty.
|
1201
|
+
Enabled: true
|
1202
|
+
StyleGuide: http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/MissingExampleGroupArgument
|
1203
|
+
|
1204
|
+
RSpec/MultipleDescribes:
|
1205
|
+
Description: Checks for multiple top level describes.
|
1206
|
+
Enabled: true
|
1207
|
+
StyleGuide: http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/MultipleDescribes
|
1208
|
+
Exclude:
|
1209
|
+
- spec/tasks/**/*_spec.rb
|
1210
|
+
|
1211
|
+
RSpec/MultipleExpectations:
|
1212
|
+
Description: Checks if examples contain too many `expect` calls.
|
1213
|
+
Enabled: false
|
1214
|
+
Max: 1
|
1215
|
+
StyleGuide: http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/MultipleExpectations
|
1216
|
+
|
1217
|
+
RSpec/MultipleSubjects:
|
1218
|
+
Description: Checks if an example group defines `subject` multiple times.
|
1219
|
+
Enabled: true
|
1220
|
+
StyleGuide: http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/MultipleSubjects
|
1221
|
+
|
1222
|
+
RSpec/NamedSubject:
|
1223
|
+
Description: Checks for explicitly referenced test subjects.
|
1224
|
+
Enabled: true
|
1225
|
+
Exclude:
|
1226
|
+
- spec/tasks/**/*
|
1227
|
+
StyleGuide: http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/NamedSubject
|
1228
|
+
|
1229
|
+
RSpec/NestedGroups:
|
1230
|
+
Description: Checks for nested example groups.
|
1231
|
+
Enabled: false
|
1232
|
+
Max: 5
|
1233
|
+
StyleGuide: http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/NestedGroups
|
1234
|
+
|
1235
|
+
RSpec/NotToNot:
|
1236
|
+
Description: Checks for consistent method usage for negating expectations.
|
1237
|
+
EnforcedStyle: not_to
|
1238
|
+
SupportedStyles:
|
1239
|
+
- not_to
|
1240
|
+
- to_not
|
1241
|
+
Enabled: true
|
1242
|
+
StyleGuide: http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/NotToNot
|
1243
|
+
|
1244
|
+
RSpec/OverwritingSetup:
|
1245
|
+
Enabled: true
|
1246
|
+
Description: Checks if there is a let/subject that overwrites an existing one.
|
1247
|
+
StyleGuide: http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/OverwritingSetup
|
1248
|
+
|
1249
|
+
RSpec/Pending:
|
1250
|
+
Enabled: true
|
1251
|
+
Description: Checks for any pending or skipped examples.
|
1252
|
+
StyleGuide: http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Pending
|
1253
|
+
|
1254
|
+
RSpec/ReceiveCounts:
|
1255
|
+
Enabled: true
|
1256
|
+
Description: Check for `once` and `twice` receive counts matchers usage.
|
1257
|
+
StyleGuide: http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ReceiveCounts
|
1258
|
+
|
1259
|
+
RSpec/ReceiveNever:
|
1260
|
+
Enabled: true
|
1261
|
+
Description: Prefer `not_to receive(...)` over `receive(...).never`.
|
1262
|
+
StyleGuide: http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ReceiveNever
|
1263
|
+
|
1264
|
+
RSpec/RepeatedDescription:
|
1265
|
+
Enabled: true
|
1266
|
+
Description: Check for repeated description strings in example groups.
|
1267
|
+
StyleGuide: http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/RepeatedDescription
|
1268
|
+
|
1269
|
+
RSpec/RepeatedExample:
|
1270
|
+
Enabled: true
|
1271
|
+
Description: Check for repeated examples within example groups.
|
1272
|
+
StyleGuide: http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/RepeatedExample
|
1273
|
+
|
1274
|
+
RSpec/RepeatedExampleGroupBody:
|
1275
|
+
Enabled: true
|
1276
|
+
Description: Check for repeated examples within example groups.
|
1277
|
+
StyleGuide: http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/RepeatedExample
|
1278
|
+
Exclude:
|
1279
|
+
- spec/tasks/**/*
|
1280
|
+
|
1281
|
+
RSpec/ReturnFromStub:
|
1282
|
+
Enabled: true
|
1283
|
+
Description: Checks for consistent style of stub's return setting.
|
1284
|
+
EnforcedStyle: and_return
|
1285
|
+
SupportedStyles:
|
1286
|
+
- and_return
|
1287
|
+
- block
|
1288
|
+
StyleGuide: http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ReturnFromStub
|
1289
|
+
|
1290
|
+
RSpec/SharedContext:
|
1291
|
+
Description: Checks for proper shared_context and shared_examples usage.
|
1292
|
+
Enabled: true
|
1293
|
+
StyleGuide: http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/SharedContext
|
1294
|
+
|
1295
|
+
RSpec/SharedExamples:
|
1296
|
+
Description: Enforces use of string to titleize shared examples.
|
1297
|
+
Enabled: true
|
1298
|
+
StyleGuide: http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/SharedExamples
|
1299
|
+
|
1300
|
+
RSpec/SingleArgumentMessageChain:
|
1301
|
+
Description: Checks that chains of messages contain more than one element.
|
1302
|
+
Enabled: true
|
1303
|
+
StyleGuide: http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/SingleArgumentMessageChain
|
1304
|
+
|
1305
|
+
RSpec/ScatteredLet:
|
1306
|
+
Description: Checks for let scattered across the example group.
|
1307
|
+
Enabled: true
|
1308
|
+
StyleGuide: http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ScatteredLet
|
1309
|
+
|
1310
|
+
RSpec/ScatteredSetup:
|
1311
|
+
Description: Checks for setup scattered across multiple hooks in an example group.
|
1312
|
+
Enabled: true
|
1313
|
+
StyleGuide: http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ScatteredSetup
|
1314
|
+
|
1315
|
+
RSpec/SubjectStub:
|
1316
|
+
Description: Checks for stubbed test subjects.
|
1317
|
+
Enabled: true
|
1318
|
+
StyleGuide: http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/SubjectStub
|
1319
|
+
|
1320
|
+
RSpec/PredicateMatcher:
|
1321
|
+
Description: Prefer using predicate matcher over using predicate method directly.
|
1322
|
+
Enabled: true
|
1323
|
+
Strict: true
|
1324
|
+
EnforcedStyle: inflected
|
1325
|
+
SupportedStyles:
|
1326
|
+
- inflected
|
1327
|
+
- explicit
|
1328
|
+
StyleGuide: http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/PredicateMatcher
|
1329
|
+
|
1330
|
+
RSpec/VerifiedDoubles:
|
1331
|
+
Description: Prefer using verifying doubles over normal doubles.
|
1332
|
+
Enabled: true
|
1333
|
+
IgnoreSymbolicNames: false
|
1334
|
+
StyleGuide: http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/VerifiedDoubles
|
1335
|
+
|
1336
|
+
RSpec/VoidExpect:
|
1337
|
+
Description: This cop checks void `expect()`.
|
1338
|
+
Enabled: true
|
1339
|
+
StyleGuide: http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/VoidExpect
|