art-rubocop 1.0.9 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/default.yml CHANGED
@@ -9,61 +9,61 @@ AllCops:
9
9
  RubyInterpreters:
10
10
  - ruby
11
11
  Include:
12
- - '**/*.rb'
13
- - '**/*.rake'
14
- - '**/*.ru'
15
- - '**/Gemfile'
16
- - '**/Rakefile'
12
+ - "**/*.rb"
13
+ - "**/*.rake"
14
+ - "**/*.ru"
15
+ - "**/Gemfile"
16
+ - "**/Rakefile"
17
17
  Exclude:
18
- - 'app/javascript/**'
19
- - 'db/schema.rb'
20
- - 'node_modules/**/*'
21
- - 'tmp/**/*'
22
- - 'vendor/**/*'
23
- - '.git/**/*'
18
+ - "app/javascript/**"
19
+ - "db/schema.rb"
20
+ - "node_modules/**/*"
21
+ - "tmp/**/*"
22
+ - "vendor/**/*"
23
+ - ".git/**/*"
24
24
  - node_modules/**/*
25
25
  - tmp/**/*
26
26
  - vendor/**/*
27
27
  - .git/**/*
28
- TargetRubyVersion: 2.6
28
+ TargetRubyVersion: 3.1
29
29
 
30
30
  #################### Layout ###########################
31
31
 
32
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'
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
35
  Enabled: false
36
36
 
37
37
  Layout/HashAlignment:
38
- Description: 'Here we check if the keys of a hash are properly aligned'
38
+ Description: "Here we check if the keys of a hash are properly aligned"
39
39
  Enabled: true
40
40
  EnforcedLastArgumentHashStyle: ignore_implicit
41
41
 
42
42
  Layout/ConditionPosition:
43
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'
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
47
  Enabled: false
48
48
 
49
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'
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
52
  EnforcedStyle: trailing
53
53
 
54
54
  Layout/EmptyLinesAroundAttributeAccessor:
55
55
  Description: "Keep blank lines around attribute accessors."
56
- StyleGuide: '#empty-lines-around-attribute-accessor'
56
+ StyleGuide: "#empty-lines-around-attribute-accessor"
57
57
  Enabled: true
58
58
  AllowAliasSyntax: false
59
59
 
60
60
  Layout/ExtraSpacing:
61
- Description: 'Do not use unnecessary spacing.'
61
+ Description: "Do not use unnecessary spacing."
62
62
  Enabled: true
63
63
 
64
64
  Layout/LineLength:
65
- Description: 'Limit lines to 100 characters.'
66
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#80-character-limits'
65
+ Description: "Limit lines to 100 characters."
66
+ StyleGuide: "https://github.com/bbatsov/ruby-style-guide#80-character-limits"
67
67
  Max: 100
68
68
  Exclude:
69
69
  - config/environments/**/*
@@ -75,15 +75,15 @@ Layout/LineLength:
75
75
 
76
76
  Layout/MultilineOperationIndentation:
77
77
  Description: >-
78
- Checks indentation of binary operations that span more than
79
- one line.
78
+ Checks indentation of binary operations that span more than
79
+ one line.
80
80
  Enabled: true
81
81
  EnforcedStyle: indented
82
82
 
83
83
  Layout/MultilineMethodCallIndentation:
84
84
  Description: >-
85
- Checks indentation of method calls with the dot operator
86
- that span more than one line.
85
+ Checks indentation of method calls with the dot operator
86
+ that span more than one line.
87
87
  Enabled: true
88
88
  EnforcedStyle: indented
89
89
 
@@ -105,27 +105,27 @@ Layout/InitialIndentation:
105
105
  Enabled: false
106
106
 
107
107
  Layout/SpaceAroundMethodCallOperator:
108
- Description: 'Checks method call operators to not have spaces around them.'
108
+ Description: "Checks method call operators to not have spaces around them."
109
109
  Enabled: true
110
110
 
111
111
  ##################### Lint ###########################
112
112
 
113
113
  Lint/AmbiguousOperator:
114
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'
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
118
  Enabled: false
119
119
 
120
120
  Lint/AmbiguousRegexpLiteral:
121
121
  Description: >-
122
- Checks for ambiguous regexp literals in the first argument of
123
- a method invocation without parenthesis.
122
+ Checks for ambiguous regexp literals in the first argument of
123
+ a method invocation without parenthesis.
124
124
  Enabled: false
125
125
 
126
126
  Lint/AssignmentInCondition:
127
127
  Description: "Don't use assignment in conditions."
128
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#safe-assignment-in-condition'
128
+ StyleGuide: "https://github.com/bbatsov/ruby-style-guide#safe-assignment-in-condition"
129
129
  Enabled: false
130
130
 
131
131
  Lint/CircularArgumentReference:
@@ -133,7 +133,7 @@ Lint/CircularArgumentReference:
133
133
  Enabled: false
134
134
 
135
135
  Lint/DeprecatedClassMethods:
136
- Description: 'Check for deprecated class method calls.'
136
+ Description: "Check for deprecated class method calls."
137
137
  Enabled: false
138
138
 
139
139
  Lint/DeprecatedOpenSSLConstant:
@@ -141,114 +141,114 @@ Lint/DeprecatedOpenSSLConstant:
141
141
  Enabled: true
142
142
 
143
143
  Lint/MixedRegexpCaptureTypes:
144
- Description: 'Do not mix named captures and numbered captures in a Regexp literal.'
144
+ Description: "Do not mix named captures and numbered captures in a Regexp literal."
145
145
  Enabled: true
146
146
 
147
147
  Lint/DuplicateHashKey:
148
- Description: 'Check for duplicate keys in hash literals.'
148
+ Description: "Check for duplicate keys in hash literals."
149
149
  Enabled: false
150
150
 
151
151
  Lint/EachWithObjectArgument:
152
- Description: 'Check for immutable argument given to each_with_object.'
152
+ Description: "Check for immutable argument given to each_with_object."
153
153
  Enabled: false
154
154
 
155
155
  Lint/ElseLayout:
156
- Description: 'Check for odd code arrangement in an else block.'
156
+ Description: "Check for odd code arrangement in an else block."
157
157
  Enabled: false
158
158
 
159
159
  Lint/EmptyWhen:
160
- Description: 'Avoid when branches without a body.'
160
+ Description: "Avoid when branches without a body."
161
161
  Enabled: false
162
162
 
163
163
  Lint/FormatParameterMismatch:
164
- Description: 'The number of parameters to format/sprint must match the fields.'
164
+ Description: "The number of parameters to format/sprint must match the fields."
165
165
  Enabled: false
166
166
 
167
167
  Lint/FlipFlop:
168
- Description: 'Checks for flip flops'
169
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-flip-flops'
168
+ Description: "Checks for flip flops"
169
+ StyleGuide: "https://github.com/bbatsov/ruby-style-guide#no-flip-flops"
170
170
  Enabled: false
171
171
 
172
172
  Lint/SuppressedException:
173
173
  Description: "Don't suppress exception."
174
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#dont-hide-exceptions'
174
+ StyleGuide: "https://github.com/bbatsov/ruby-style-guide#dont-hide-exceptions"
175
175
  Enabled: false
176
176
 
177
177
  Lint/LiteralAsCondition:
178
- Description: 'Checks of literals used in conditions.'
178
+ Description: "Checks of literals used in conditions."
179
179
  Enabled: false
180
180
 
181
181
  Lint/LiteralInInterpolation:
182
- Description: 'Checks for literals used in interpolation.'
182
+ Description: "Checks for literals used in interpolation."
183
183
  Enabled: false
184
184
 
185
185
  Lint/Loop:
186
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'
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
190
  Enabled: false
191
191
 
192
192
  Lint/NestedMethodDefinition:
193
- Description: 'Do not use nested method definitions.'
194
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-methods'
193
+ Description: "Do not use nested method definitions."
194
+ StyleGuide: "https://github.com/bbatsov/ruby-style-guide#no-nested-methods"
195
195
  Enabled: false
196
196
 
197
197
  Lint/NonLocalExitFromIterator:
198
- Description: 'Do not use return in iterator to cause non-local exit.'
198
+ Description: "Do not use return in iterator to cause non-local exit."
199
199
  Enabled: false
200
200
 
201
201
  Lint/ParenthesesAsGroupedExpression:
202
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'
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
206
  Enabled: false
207
207
 
208
208
  Lint/RaiseException:
209
209
  Description: Checks for `raise` or `fail` statements which are raising `Exception` class.
210
- StyleGuide: '#raise-exception'
210
+ StyleGuide: "#raise-exception"
211
211
  Enabled: true
212
212
  Safe: false
213
213
  AllowedImplicitNamespaces:
214
- - 'Gem'
214
+ - "Gem"
215
215
 
216
216
  Lint/RedundantCopDisableDirective:
217
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.
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
221
  Enabled: true
222
222
 
223
223
  Lint/RequireParentheses:
224
224
  Description: >-
225
- Use parentheses in the method call to avoid confusion
226
- about precedence.
225
+ Use parentheses in the method call to avoid confusion
226
+ about precedence.
227
227
  Enabled: false
228
228
 
229
229
  Lint/StructNewOverride:
230
- Description: 'Disallow overriding the `Struct` built-in methods via `Struct.new`.'
230
+ Description: "Disallow overriding the `Struct` built-in methods via `Struct.new`."
231
231
  Enabled: true
232
- VersionAdded: '0.81'
232
+ VersionAdded: "0.81"
233
233
 
234
234
  Lint/UnderscorePrefixedVariableName:
235
- Description: 'Do not use prefix `_` for a variable that is used.'
235
+ Description: "Do not use prefix `_` for a variable that is used."
236
236
  Enabled: false
237
237
 
238
238
  Lint/Void:
239
- Description: 'Possible use of operator/literal/variable in void context.'
239
+ Description: "Possible use of operator/literal/variable in void context."
240
240
  Enabled: false
241
241
 
242
242
  ##################### Metrics ###########################
243
243
 
244
244
  Metrics/AbcSize:
245
245
  Description: >-
246
- A calculated magnitude based on number of assignments,
247
- branches, and conditions.
246
+ A calculated magnitude based on number of assignments,
247
+ branches, and conditions.
248
248
  Enabled: false
249
249
 
250
250
  Metrics/BlockLength:
251
- CountComments: true # count full line comments?
251
+ CountComments: true # count full line comments?
252
252
  Max: 25
253
253
  Exclude:
254
254
  - "config/routes.rb"
@@ -260,39 +260,39 @@ Metrics/BlockLength:
260
260
  - "spec/**/*"
261
261
 
262
262
  Metrics/BlockNesting:
263
- Description: 'Avoid excessive block nesting'
264
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#three-is-the-number-thou-shalt-count'
263
+ Description: "Avoid excessive block nesting"
264
+ StyleGuide: "https://github.com/bbatsov/ruby-style-guide#three-is-the-number-thou-shalt-count"
265
265
  Enabled: false
266
266
 
267
267
  Metrics/ClassLength:
268
- Description: 'Avoid classes longer than 100 lines of code.'
268
+ Description: "Avoid classes longer than 100 lines of code."
269
269
  Enabled: false
270
270
 
271
271
  Metrics/CyclomaticComplexity:
272
272
  Description: >-
273
- A complexity metric that is strongly correlated to the number
274
- of test cases needed to validate a method.
273
+ A complexity metric that is strongly correlated to the number
274
+ of test cases needed to validate a method.
275
275
  Enabled: false
276
276
 
277
277
  Metrics/MethodLength:
278
- Description: 'Avoid methods longer than 10 lines of code.'
279
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#short-methods'
278
+ Description: "Avoid methods longer than 10 lines of code."
279
+ StyleGuide: "https://github.com/bbatsov/ruby-style-guide#short-methods"
280
280
  Enabled: true
281
281
 
282
282
  Metrics/ModuleLength:
283
- Description: 'Avoid modules longer than 100 lines of code.'
283
+ Description: "Avoid modules longer than 100 lines of code."
284
284
  Enabled: false
285
285
 
286
286
  Metrics/ParameterLists:
287
- Description: 'Avoid parameter lists longer than three or four parameters.'
288
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#too-many-params'
287
+ Description: "Avoid parameter lists longer than three or four parameters."
288
+ StyleGuide: "https://github.com/bbatsov/ruby-style-guide#too-many-params"
289
289
  Enabled: false
290
290
 
291
291
  ##################### Naming ###########################
292
292
 
293
293
  Naming/AsciiIdentifiers:
294
- Description: 'Use only ascii symbols in identifiers.'
295
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#english-identifiers'
294
+ Description: "Use only ascii symbols in identifiers."
295
+ StyleGuide: "https://github.com/bbatsov/ruby-style-guide#english-identifiers"
296
296
  Enabled: false
297
297
 
298
298
  Naming/AccessorMethodName:
@@ -300,21 +300,21 @@ Naming/AccessorMethodName:
300
300
  Enabled: false
301
301
 
302
302
  Naming/BinaryOperatorParameterName:
303
- Description: 'When defining binary operators, name the argument other.'
304
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#other-arg'
303
+ Description: "When defining binary operators, name the argument other."
304
+ StyleGuide: "https://github.com/bbatsov/ruby-style-guide#other-arg"
305
305
  Enabled: false
306
306
 
307
307
  Naming/FileName:
308
- Description: 'Use snake_case for source file names.'
309
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#snake-case-files'
308
+ Description: "Use snake_case for source file names."
309
+ StyleGuide: "https://github.com/bbatsov/ruby-style-guide#snake-case-files"
310
310
  Enabled: false
311
311
 
312
312
  Naming/MemoizedInstanceVariableName:
313
313
  Enabled: false
314
314
 
315
315
  Naming/PredicateName:
316
- Description: 'Check the names of predicate methods.'
317
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#bool-methods-qmark'
316
+ Description: "Check the names of predicate methods."
317
+ StyleGuide: "https://github.com/bbatsov/ruby-style-guide#bool-methods-qmark"
318
318
  ForbiddenPrefixes:
319
319
  - is_
320
320
  Exclude:
@@ -333,8 +333,8 @@ Naming/VariableName:
333
333
  ##################### Style ###########################
334
334
 
335
335
  Style/Alias:
336
- Description: 'Use alias_method instead of alias.'
337
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#alias-method'
336
+ Description: "Use alias_method instead of alias."
337
+ StyleGuide: "https://github.com/bbatsov/ruby-style-guide#alias-method"
338
338
  Enabled: false
339
339
 
340
340
  Style/AndOr:
@@ -343,38 +343,38 @@ Style/AndOr:
343
343
  - app/controllers/**/*.rb
344
344
 
345
345
  Style/ArrayJoin:
346
- Description: 'Use Array#join instead of Array#*.'
347
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#array-join'
346
+ Description: "Use Array#join instead of Array#*."
347
+ StyleGuide: "https://github.com/bbatsov/ruby-style-guide#array-join"
348
348
  Enabled: false
349
349
 
350
350
  Style/AsciiComments:
351
- Description: 'Use only ascii symbols in comments.'
352
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#english-comments'
351
+ Description: "Use only ascii symbols in comments."
352
+ StyleGuide: "https://github.com/bbatsov/ruby-style-guide#english-comments"
353
353
  Enabled: false
354
354
 
355
355
  Style/Attr:
356
- Description: 'Checks for uses of Module#attr.'
357
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#attr'
356
+ Description: "Checks for uses of Module#attr."
357
+ StyleGuide: "https://github.com/bbatsov/ruby-style-guide#attr"
358
358
  Enabled: false
359
359
 
360
360
  Style/CaseEquality:
361
- Description: 'Avoid explicit use of the case equality operator(===).'
362
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-case-equality'
361
+ Description: "Avoid explicit use of the case equality operator(===)."
362
+ StyleGuide: "https://github.com/bbatsov/ruby-style-guide#no-case-equality"
363
363
  Enabled: true
364
364
 
365
365
  Style/CharacterLiteral:
366
- Description: 'Checks for uses of character literals.'
367
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-character-literals'
366
+ Description: "Checks for uses of character literals."
367
+ StyleGuide: "https://github.com/bbatsov/ruby-style-guide#no-character-literals"
368
368
  Enabled: false
369
369
 
370
370
  Style/ClassAndModuleChildren:
371
- Description: 'Checks style of children classes and modules.'
371
+ Description: "Checks style of children classes and modules."
372
372
  Enabled: false
373
373
  EnforcedStyle: nested
374
374
 
375
375
  Style/ClassVars:
376
- Description: 'Avoid the use of class variables.'
377
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-class-vars'
376
+ Description: "Avoid the use of class variables."
377
+ StyleGuide: "https://github.com/bbatsov/ruby-style-guide#no-class-vars"
378
378
  Enabled: true
379
379
 
380
380
  Style/CollectionMethods:
@@ -387,47 +387,47 @@ Style/CollectionMethods:
387
387
 
388
388
  Style/HashAsLastArrayItem:
389
389
  Enabled: true
390
- StyleGuide: 'https://github.com/rubocop-hq/ruby-style-guide#hash-literal-as-last-array-item'
390
+ StyleGuide: "https://github.com/rubocop-hq/ruby-style-guide#hash-literal-as-last-array-item"
391
391
  EnforcedStyle: no_braces
392
392
 
393
393
  Style/ColonMethodCall:
394
- Description: 'Do not use :: for method call.'
395
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#double-colons'
394
+ Description: "Do not use :: for method call."
395
+ StyleGuide: "https://github.com/bbatsov/ruby-style-guide#double-colons"
396
396
  Enabled: false
397
397
 
398
398
  Style/CommentAnnotation:
399
399
  Description: >-
400
- Checks formatting of special comments
401
- (TODO, FIXME, OPTIMIZE, HACK, REVIEW).
402
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#annotate-keywords'
400
+ Checks formatting of special comments
401
+ (TODO, FIXME, OPTIMIZE, HACK, REVIEW).
402
+ StyleGuide: "https://github.com/bbatsov/ruby-style-guide#annotate-keywords"
403
403
  Enabled: false
404
404
 
405
405
  Style/ConditionalAssignment:
406
406
  Description: >-
407
- Use the return of the conditional for variable assignment and
408
- comparison.
407
+ Use the return of the conditional for variable assignment and
408
+ comparison.
409
409
  Enabled: false
410
410
 
411
411
  Style/Documentation:
412
- Description: 'Document classes and non-namespace modules.'
412
+ Description: "Document classes and non-namespace modules."
413
413
  Enabled: false
414
414
 
415
415
  Style/DoubleNegation:
416
- Description: 'Checks for uses of double negation (!!).'
417
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-bang-bang'
416
+ Description: "Checks for uses of double negation (!!)."
417
+ StyleGuide: "https://github.com/bbatsov/ruby-style-guide#no-bang-bang"
418
418
  Enabled: false
419
419
 
420
420
  Style/EachWithObject:
421
- Description: 'Prefer `each_with_object` over `inject` or `reduce`.'
421
+ Description: "Prefer `each_with_object` over `inject` or `reduce`."
422
422
  Enabled: true
423
423
 
424
424
  Style/EmptyLiteral:
425
- Description: 'Prefer literals to Array.new/Hash.new/String.new.'
426
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#literal-array-hash'
425
+ Description: "Prefer literals to Array.new/Hash.new/String.new."
426
+ StyleGuide: "https://github.com/bbatsov/ruby-style-guide#literal-array-hash"
427
427
  Enabled: true
428
428
 
429
429
  Style/EmptyMethod:
430
- Description: 'Put empty methods on a single line.'
430
+ Description: "Put empty methods on a single line."
431
431
  Enabled: true
432
432
 
433
433
  # Checks whether the source file has a utf-8 encoding comment or not
@@ -437,15 +437,15 @@ Style/Encoding:
437
437
  Enabled: false
438
438
 
439
439
  Style/EvenOdd:
440
- Description: 'Favor the use of Fixnum#even? && Fixnum#odd?'
441
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#predicate-methods'
440
+ Description: "Favor the use of Fixnum#even? && Fixnum#odd?"
441
+ StyleGuide: "https://github.com/bbatsov/ruby-style-guide#predicate-methods"
442
442
  Enabled: true
443
443
 
444
444
  Style/ExponentialNotation:
445
- Description: 'When using exponential notation, favor a mantissa between 1 (inclusive) and 10 (exclusive).'
446
- StyleGuide: '#exponential-notation'
445
+ Description: "When using exponential notation, favor a mantissa between 1 (inclusive) and 10 (exclusive)."
446
+ StyleGuide: "#exponential-notation"
447
447
  Enabled: true
448
- VersionAdded: '0.82'
448
+ VersionAdded: "0.82"
449
449
  EnforcedStyle: scientific
450
450
  SupportedStyles:
451
451
  - scientific
@@ -459,112 +459,111 @@ Style/FrozenStringLiteralComment:
459
459
  Enabled: false
460
460
 
461
461
  Style/FormatString:
462
- Description: 'Enforce the use of Kernel#sprintf, Kernel#format or String#%.'
463
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#sprintf'
462
+ Description: "Enforce the use of Kernel#sprintf, Kernel#format or String#%."
463
+ StyleGuide: "https://github.com/bbatsov/ruby-style-guide#sprintf"
464
464
  Enabled: false
465
465
 
466
466
  Style/FormatStringToken:
467
467
  Enabled: false
468
468
 
469
469
  Style/GlobalVars:
470
- Description: 'Do not introduce global variables.'
471
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#instance-vars'
472
- Reference: 'http://www.zenspider.com/Languages/Ruby/QuickRef.html'
470
+ Description: "Do not introduce global variables."
471
+ StyleGuide: "https://github.com/bbatsov/ruby-style-guide#instance-vars"
472
+ Reference: "http://www.zenspider.com/Languages/Ruby/QuickRef.html"
473
473
  Enabled: false
474
474
 
475
475
  Style/GuardClause:
476
- Description: 'Check for conditionals that can be replaced with guard clauses'
477
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals'
476
+ Description: "Check for conditionals that can be replaced with guard clauses"
477
+ StyleGuide: "https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals"
478
478
  Enabled: true
479
479
 
480
480
  Style/HashEachMethods:
481
- Description: 'Use Hash#each_key and Hash#each_value.'
482
- StyleGuide: '#hash-each'
481
+ Description: "Use Hash#each_key and Hash#each_value."
482
+ StyleGuide: "#hash-each"
483
483
  Enabled: true
484
- VersionAdded: '0.80'
484
+ VersionAdded: "0.80"
485
485
  Safe: false
486
486
 
487
487
  Style/HashTransformKeys:
488
- Description: 'Prefer `transform_keys` over `each_with_object` and `map`.'
488
+ Description: "Prefer `transform_keys` over `each_with_object` and `map`."
489
489
  Enabled: true
490
- VersionAdded: '0.80'
490
+ VersionAdded: "0.80"
491
491
  Safe: false
492
492
 
493
493
  Style/HashTransformValues:
494
- Description: 'Prefer `transform_values` over `each_with_object` and `map`.'
494
+ Description: "Prefer `transform_values` over `each_with_object` and `map`."
495
495
  Enabled: true
496
- VersionAdded: '0.80'
496
+ VersionAdded: "0.80"
497
497
  Safe: false
498
498
 
499
499
  Style/IfUnlessModifier:
500
500
  Description: >-
501
- Favor modifier if/unless usage when you have a
502
- single-line body.
503
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#if-as-a-modifier'
501
+ Favor modifier if/unless usage when you have a
502
+ single-line body.
503
+ StyleGuide: "https://github.com/bbatsov/ruby-style-guide#if-as-a-modifier"
504
504
  Enabled: true
505
505
 
506
506
  Style/IfWithSemicolon:
507
- Description: 'Do not use if x; .... Use the ternary operator instead.'
508
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-semicolon-ifs'
507
+ Description: "Do not use if x; .... Use the ternary operator instead."
508
+ StyleGuide: "https://github.com/bbatsov/ruby-style-guide#no-semicolon-ifs"
509
509
  Enabled: false
510
510
 
511
511
  Style/InlineComment:
512
- Description: 'Avoid inline comments.'
512
+ Description: "Avoid inline comments."
513
513
  Enabled: false
514
514
 
515
515
  Style/Lambda:
516
- Description: 'Use the new lambda literal syntax for single-line blocks.'
517
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#lambda-multi-line'
516
+ Description: "Use the new lambda literal syntax for single-line blocks."
517
+ StyleGuide: "https://github.com/bbatsov/ruby-style-guide#lambda-multi-line"
518
518
  Enabled: true
519
519
 
520
520
  Style/LambdaCall:
521
- Description: 'Use lambda.call(...) instead of lambda.(...).'
522
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#proc-call'
521
+ Description: "Use lambda.call(...) instead of lambda.(...)."
522
+ StyleGuide: "https://github.com/bbatsov/ruby-style-guide#proc-call"
523
523
  Enabled: false
524
524
 
525
525
  Style/LineEndConcatenation:
526
526
  Description: >-
527
- Use \ instead of + or << to concatenate two string literals at
528
- line end.
527
+ Use \ instead of + or << to concatenate two string literals at
528
+ line end.
529
529
  Enabled: false
530
530
 
531
-
532
531
  Style/PreferredHashMethods:
533
- Description: 'Checks use of `has_key?` and `has_value?` Hash methods.'
534
- StyleGuide: '#hash-key'
532
+ Description: "Checks use of `has_key?` and `has_value?` Hash methods."
533
+ StyleGuide: "#hash-key"
535
534
  Enabled: false
536
535
 
537
536
  Style/RedundantFetchBlock:
538
537
  Description: >-
539
- Use `fetch(key, value)` instead of `fetch(key) { value }`
540
- when value has Numeric, Rational, Complex, Symbol or String type, `false`, `true`, `nil` or is a constant.
541
- Reference: 'https://github.com/JuanitoFatas/fast-ruby#hashfetch-with-argument-vs-hashfetch--block-code'
538
+ Use `fetch(key, value)` instead of `fetch(key) { value }`
539
+ when value has Numeric, Rational, Complex, Symbol or String type, `false`, `true`, `nil` or is a constant.
540
+ Reference: "https://github.com/JuanitoFatas/fast-ruby#hashfetch-with-argument-vs-hashfetch--block-code"
542
541
  Enabled: true
543
542
  Safe: false
544
543
  # If enabled, this cop will autocorrect usages of
545
544
  # `fetch` being called with block returning a constant.
546
545
  # This can be dangerous since constants will not be defined at that moment.
547
546
  SafeForConstants: false
548
- VersionAdded: '0.86'
547
+ VersionAdded: "0.86"
549
548
 
550
549
  Style/RedundantRegexpCharacterClass:
551
- Description: 'Checks for unnecessary single-element Regexp character classes.'
550
+ Description: "Checks for unnecessary single-element Regexp character classes."
552
551
  Enabled: true
553
- VersionAdded: '0.85'
552
+ VersionAdded: "0.85"
554
553
 
555
554
  Style/RedundantRegexpEscape:
556
- Description: 'Checks for redundant escapes in Regexps.'
555
+ Description: "Checks for redundant escapes in Regexps."
557
556
  Enabled: true
558
- VersionAdded: '0.85'
557
+ VersionAdded: "0.85"
559
558
 
560
559
  Style/SafeNavigation:
561
560
  Description: >-
562
- This cop transforms usages of a method call safeguarded by
563
- a check for the existence of the object to
564
- safe navigation (`&.`).
561
+ This cop transforms usages of a method call safeguarded by
562
+ a check for the existence of the object to
563
+ safe navigation (`&.`).
565
564
  Enabled: false
566
- VersionAdded: '0.43'
567
- VersionChanged: '0.56'
565
+ VersionAdded: "0.43"
566
+ VersionChanged: "0.56"
568
567
  # Safe navigation may cause a statement to start returning `nil` in addition
569
568
  # to whatever it used to return.
570
569
  ConvertCodeThatCanStartToReturnNil: false
@@ -576,9 +575,9 @@ Style/SafeNavigation:
576
575
  - try!
577
576
 
578
577
  Style/SlicingWithRange:
579
- Description: 'Checks array slicing is done with endless ranges when suitable.'
578
+ Description: "Checks array slicing is done with endless ranges when suitable."
580
579
  Enabled: true
581
- VersionAdded: '0.83'
580
+ VersionAdded: "0.83"
582
581
  Safe: false
583
582
 
584
583
  Style/SymbolProc:
@@ -587,54 +586,54 @@ Style/SymbolProc:
587
586
  - config/initializers/**/*
588
587
 
589
588
  Style/ModuleFunction:
590
- Description: 'Checks for usage of `extend self` in modules.'
591
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#module-function'
589
+ Description: "Checks for usage of `extend self` in modules."
590
+ StyleGuide: "https://github.com/bbatsov/ruby-style-guide#module-function"
592
591
  Enabled: false
593
592
 
594
593
  Style/MultilineBlockChain:
595
- Description: 'Avoid multi-line chains of blocks.'
596
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#single-line-blocks'
594
+ Description: "Avoid multi-line chains of blocks."
595
+ StyleGuide: "https://github.com/bbatsov/ruby-style-guide#single-line-blocks"
597
596
  Enabled: false
598
597
 
599
598
  Style/NegatedIf:
600
599
  Description: >-
601
- Favor unless over if for negative conditions
602
- (or control flow or).
603
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#unless-for-negatives'
600
+ Favor unless over if for negative conditions
601
+ (or control flow or).
602
+ StyleGuide: "https://github.com/bbatsov/ruby-style-guide#unless-for-negatives"
604
603
  Enabled: false
605
604
 
606
605
  Style/NegatedWhile:
607
- Description: 'Favor until over while for negative conditions.'
608
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#until-for-negatives'
606
+ Description: "Favor until over while for negative conditions."
607
+ StyleGuide: "https://github.com/bbatsov/ruby-style-guide#until-for-negatives"
609
608
  Enabled: false
610
609
 
611
610
  Style/Next:
612
- Description: 'Use `next` to skip iteration instead of a condition at the end.'
613
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals'
611
+ Description: "Use `next` to skip iteration instead of a condition at the end."
612
+ StyleGuide: "https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals"
614
613
  Enabled: false
615
614
 
616
615
  Style/NilComparison:
617
- Description: 'Prefer x.nil? to x == nil.'
618
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#predicate-methods'
616
+ Description: "Prefer x.nil? to x == nil."
617
+ StyleGuide: "https://github.com/bbatsov/ruby-style-guide#predicate-methods"
619
618
  Enabled: false
620
619
 
621
620
  Style/Not:
622
- Description: 'Use ! instead of not.'
623
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#bang-not-not'
621
+ Description: "Use ! instead of not."
622
+ StyleGuide: "https://github.com/bbatsov/ruby-style-guide#bang-not-not"
624
623
  Enabled: false
625
624
 
626
625
  Style/NumericLiterals:
627
626
  Description: >-
628
- Add underscores to large numeric literals to improve their
629
- readability.
630
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#underscores-in-numerics'
627
+ Add underscores to large numeric literals to improve their
628
+ readability.
629
+ StyleGuide: "https://github.com/bbatsov/ruby-style-guide#underscores-in-numerics"
631
630
  Enabled: false
632
631
 
633
632
  Style/OneLineConditional:
634
633
  Description: >-
635
- Favor the ternary operator(?:) over
636
- if/then/else/end constructs.
637
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#ternary-operator'
634
+ Favor the ternary operator(?:) over
635
+ if/then/else/end constructs.
636
+ StyleGuide: "https://github.com/bbatsov/ruby-style-guide#ternary-operator"
638
637
  Enabled: false
639
638
 
640
639
  Style/IfInsideElse:
@@ -644,75 +643,75 @@ Style/NumericPredicate:
644
643
  Enabled: false
645
644
 
646
645
  Style/PercentLiteralDelimiters:
647
- Description: 'Use `%`-literal delimiters consistently'
648
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-literal-braces'
646
+ Description: "Use `%`-literal delimiters consistently"
647
+ StyleGuide: "https://github.com/bbatsov/ruby-style-guide#percent-literal-braces"
649
648
  Enabled: false
650
649
 
651
650
  Style/PerlBackrefs:
652
- Description: 'Avoid Perl-style regex back references.'
653
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-perl-regexp-last-matchers'
651
+ Description: "Avoid Perl-style regex back references."
652
+ StyleGuide: "https://github.com/bbatsov/ruby-style-guide#no-perl-regexp-last-matchers"
654
653
  Enabled: false
655
654
 
656
655
  Style/Proc:
657
- Description: 'Use proc instead of Proc.new.'
658
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#proc'
656
+ Description: "Use proc instead of Proc.new."
657
+ StyleGuide: "https://github.com/bbatsov/ruby-style-guide#proc"
659
658
  Enabled: false
660
659
 
661
660
  Style/RaiseArgs:
662
- Description: 'Checks the arguments passed to raise/fail.'
663
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#exception-class-messages'
661
+ Description: "Checks the arguments passed to raise/fail."
662
+ StyleGuide: "https://github.com/bbatsov/ruby-style-guide#exception-class-messages"
664
663
  Enabled: false
665
664
 
666
665
  Style/RegexpLiteral:
667
- Description: 'Use / or %r around regular expressions.'
668
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-r'
666
+ Description: "Use / or %r around regular expressions."
667
+ StyleGuide: "https://github.com/bbatsov/ruby-style-guide#percent-r"
669
668
  Enabled: false
670
669
 
671
670
  Style/Sample:
672
671
  Description: >-
673
- Use `sample` instead of `shuffle.first`,
674
- `shuffle.last`, and `shuffle[Fixnum]`.
675
- Reference: 'https://github.com/JuanitoFatas/fast-ruby#arrayshufflefirst-vs-arraysample-code'
672
+ Use `sample` instead of `shuffle.first`,
673
+ `shuffle.last`, and `shuffle[Fixnum]`.
674
+ Reference: "https://github.com/JuanitoFatas/fast-ruby#arrayshufflefirst-vs-arraysample-code"
676
675
  Enabled: true
677
676
 
678
677
  Style/SelfAssignment:
679
678
  Description: >-
680
- Checks for places where self-assignment shorthand should have
681
- been used.
682
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#self-assignment'
679
+ Checks for places where self-assignment shorthand should have
680
+ been used.
681
+ StyleGuide: "https://github.com/bbatsov/ruby-style-guide#self-assignment"
683
682
  Enabled: false
684
683
 
685
684
  Style/SingleLineBlockParams:
686
- Description: 'Enforces the names of some block params.'
687
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#reduce-blocks'
685
+ Description: "Enforces the names of some block params."
686
+ StyleGuide: "https://github.com/bbatsov/ruby-style-guide#reduce-blocks"
688
687
  Enabled: false
689
688
 
690
689
  Style/SingleLineMethods:
691
- Description: 'Avoid single-line methods.'
692
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-single-line-methods'
690
+ Description: "Avoid single-line methods."
691
+ StyleGuide: "https://github.com/bbatsov/ruby-style-guide#no-single-line-methods"
693
692
  Enabled: false
694
693
 
695
694
  Style/SignalException:
696
- Description: 'Checks for proper usage of fail and raise.'
697
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#fail-method'
695
+ Description: "Checks for proper usage of fail and raise."
696
+ StyleGuide: "https://github.com/bbatsov/ruby-style-guide#fail-method"
698
697
  Enabled: true
699
698
 
700
699
  Style/SpecialGlobalVars:
701
- Description: 'Avoid Perl-style global variables.'
702
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-cryptic-perlisms'
700
+ Description: "Avoid Perl-style global variables."
701
+ StyleGuide: "https://github.com/bbatsov/ruby-style-guide#no-cryptic-perlisms"
703
702
  Enabled: false
704
703
 
705
704
  Style/StringLiterals:
706
- Description: 'Checks if uses of quotes match the configured preference.'
707
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#consistent-string-literals'
705
+ Description: "Checks if uses of quotes match the configured preference."
706
+ StyleGuide: "https://github.com/bbatsov/ruby-style-guide#consistent-string-literals"
708
707
  EnforcedStyle: double_quotes
709
708
  Enabled: true
710
709
  Exclude:
711
710
  - config/environment.rb
712
711
 
713
712
  Style/TrailingCommaInArguments:
714
- Description: 'Checks for trailing comma in argument lists.'
715
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
713
+ Description: "Checks for trailing comma in argument lists."
714
+ StyleGuide: "https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas"
716
715
  EnforcedStyleForMultiline: comma
717
716
  SupportedStylesForMultiline:
718
717
  - comma
@@ -721,8 +720,8 @@ Style/TrailingCommaInArguments:
721
720
  Enabled: true
722
721
 
723
722
  Style/TrailingCommaInArrayLiteral:
724
- Description: 'Checks for trailing comma in array and hash literals.'
725
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
723
+ Description: "Checks for trailing comma in array and hash literals."
724
+ StyleGuide: "https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas"
726
725
  EnforcedStyleForMultiline: comma
727
726
  SupportedStylesForMultiline:
728
727
  - comma
@@ -731,8 +730,8 @@ Style/TrailingCommaInArrayLiteral:
731
730
  Enabled: true
732
731
 
733
732
  Style/TrailingCommaInHashLiteral:
734
- Description: 'Checks for trailing comma in array and hash literals.'
735
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
733
+ Description: "Checks for trailing comma in array and hash literals."
734
+ StyleGuide: "https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas"
736
735
  EnforcedStyleForMultiline: comma
737
736
  SupportedStylesForMultiline:
738
737
  - comma
@@ -741,124 +740,124 @@ Style/TrailingCommaInHashLiteral:
741
740
  Enabled: true
742
741
 
743
742
  Style/TrivialAccessors:
744
- Description: 'Prefer attr_* methods to trivial readers/writers.'
745
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#attr_family'
743
+ Description: "Prefer attr_* methods to trivial readers/writers."
744
+ StyleGuide: "https://github.com/bbatsov/ruby-style-guide#attr_family"
746
745
  Enabled: false
747
746
 
748
747
  Style/VariableInterpolation:
749
748
  Description: >-
750
- Don't interpolate global, instance and class variables
751
- directly in strings.
752
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#curlies-interpolate'
749
+ Don't interpolate global, instance and class variables
750
+ directly in strings.
751
+ StyleGuide: "https://github.com/bbatsov/ruby-style-guide#curlies-interpolate"
753
752
  Enabled: false
754
753
 
755
754
  Style/WhenThen:
756
- Description: 'Use when x then ... for one-line cases.'
757
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#one-line-cases'
755
+ Description: "Use when x then ... for one-line cases."
756
+ StyleGuide: "https://github.com/bbatsov/ruby-style-guide#one-line-cases"
758
757
  Enabled: false
759
758
 
760
759
  Style/WhileUntilModifier:
761
760
  Description: >-
762
- Favor modifier while/until usage when you have a
763
- single-line body.
764
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#while-as-a-modifier'
761
+ Favor modifier while/until usage when you have a
762
+ single-line body.
763
+ StyleGuide: "https://github.com/bbatsov/ruby-style-guide#while-as-a-modifier"
765
764
  Enabled: false
766
765
 
767
766
  Style/WordArray:
768
- Description: 'Use %w or %W for arrays of words.'
769
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-w'
767
+ Description: "Use %w or %W for arrays of words."
768
+ StyleGuide: "https://github.com/bbatsov/ruby-style-guide#percent-w"
770
769
  Enabled: false
771
770
 
772
771
  # Performance
773
772
 
774
773
  Performance/CaseWhenSplat:
775
774
  Description: >-
776
- Place `when` conditions that use splat at the end
777
- of the list of `when` branches.
775
+ Place `when` conditions that use splat at the end
776
+ of the list of `when` branches.
778
777
  Enabled: true
779
778
 
780
779
  Performance/Count:
781
780
  Description: >-
782
- Use `count` instead of `select...size`, `reject...size`,
783
- `select...count`, `reject...count`, `select...length`,
784
- and `reject...length`.
781
+ Use `count` instead of `select...size`, `reject...size`,
782
+ `select...count`, `reject...count`, `select...length`,
783
+ and `reject...length`.
785
784
  Enabled: true
786
785
 
787
786
  Performance/Detect:
788
787
  Description: >-
789
- Use `detect` instead of `select.first`, `find_all.first`,
790
- `select.last`, and `find_all.last`.
791
- Reference: 'https://github.com/JuanitoFatas/fast-ruby#enumerabledetect-vs-enumerableselectfirst-code'
788
+ Use `detect` instead of `select.first`, `find_all.first`,
789
+ `select.last`, and `find_all.last`.
790
+ Reference: "https://github.com/JuanitoFatas/fast-ruby#enumerabledetect-vs-enumerableselectfirst-code"
792
791
  Enabled: true
793
792
 
794
793
  Performance/FlatMap:
795
794
  Description: >-
796
- Use `Enumerable#flat_map`
797
- instead of `Enumerable#map...Array#flatten(1)`
798
- or `Enumberable#collect..Array#flatten(1)`
799
- Reference: 'https://github.com/JuanitoFatas/fast-ruby#enumerablemaparrayflatten-vs-enumerableflat_map-code'
795
+ Use `Enumerable#flat_map`
796
+ instead of `Enumerable#map...Array#flatten(1)`
797
+ or `Enumberable#collect..Array#flatten(1)`
798
+ Reference: "https://github.com/JuanitoFatas/fast-ruby#enumerablemaparrayflatten-vs-enumerableflat_map-code"
800
799
  Enabled: true
801
800
 
802
801
  Performance/ReverseEach:
803
- Description: 'Use `reverse_each` instead of `reverse.each`.'
804
- Reference: 'https://github.com/JuanitoFatas/fast-ruby#enumerablereverseeach-vs-enumerablereverse_each-code'
802
+ Description: "Use `reverse_each` instead of `reverse.each`."
803
+ Reference: "https://github.com/JuanitoFatas/fast-ruby#enumerablereverseeach-vs-enumerablereverse_each-code"
805
804
  Enabled: true
806
805
 
807
806
  Performance/Size:
808
807
  Description: >-
809
- Use `size` instead of `count` for counting
810
- the number of elements in `Array` and `Hash`.
811
- Reference: 'https://github.com/JuanitoFatas/fast-ruby#arraycount-vs-arraysize-code'
808
+ Use `size` instead of `count` for counting
809
+ the number of elements in `Array` and `Hash`.
810
+ Reference: "https://github.com/JuanitoFatas/fast-ruby#arraycount-vs-arraysize-code"
812
811
  Enabled: true
813
812
 
814
813
  Performance/StringReplacement:
815
814
  Description: >-
816
- Use `tr` instead of `gsub` when you are replacing the same
817
- number of characters. Use `delete` instead of `gsub` when
818
- you are deleting characters.
819
- Reference: 'https://github.com/JuanitoFatas/fast-ruby#stringgsub-vs-stringtr-code'
815
+ Use `tr` instead of `gsub` when you are replacing the same
816
+ number of characters. Use `delete` instead of `gsub` when
817
+ you are deleting characters.
818
+ Reference: "https://github.com/JuanitoFatas/fast-ruby#stringgsub-vs-stringtr-code"
820
819
  Enabled: true
821
820
 
822
821
  # Rails
823
822
 
824
823
  Rails/ActionFilter:
825
- Description: 'Enforces consistent use of action filter methods.'
824
+ Description: "Enforces consistent use of action filter methods."
826
825
  Enabled: false
827
826
 
828
827
  Rails/Date:
829
828
  Description: >-
830
- Checks the correct usage of date aware methods,
831
- such as Date.today, Date.current etc.
829
+ Checks the correct usage of date aware methods,
830
+ such as Date.today, Date.current etc.
832
831
  Enabled: true
833
832
 
834
833
  Rails/Delegate:
835
- Description: 'Prefer delegate method for delegations.'
834
+ Description: "Prefer delegate method for delegations."
836
835
  Enabled: false
837
836
 
838
837
  Rails/DynamicFindBy:
839
- Description: 'Prefer non-dynamic finder methods.'
838
+ Description: "Prefer non-dynamic finder methods."
840
839
  Enabled: false
841
840
 
842
841
  Rails/FindBy:
843
- Description: 'Prefer find_by over where.first.'
842
+ Description: "Prefer find_by over where.first."
844
843
  Enabled: true
845
844
 
846
845
  Rails/FindEach:
847
- Description: 'Prefer all.find_each over all.find.'
846
+ Description: "Prefer all.find_each over all.find."
848
847
  Enabled: true
849
848
 
850
849
  Rails/InverseOf:
851
850
  Enabled: false
852
851
 
853
852
  Rails/HasAndBelongsToMany:
854
- Description: 'Prefer has_many :through to has_and_belongs_to_many.'
853
+ Description: "Prefer has_many :through to has_and_belongs_to_many."
855
854
  Enabled: false
856
855
 
857
856
  Rails/HasManyOrHasOneDependent:
858
- Description: 'Define the dependent option to the has_many and has_one associations.'
859
- StyleGuide: 'https://rails.rubystyle.guide#has_many-has_one-dependent-option'
857
+ Description: "Define the dependent option to the has_many and has_one associations."
858
+ StyleGuide: "https://rails.rubystyle.guide#has_many-has_one-dependent-option"
860
859
  Enabled: false
861
- VersionAdded: '0.50'
860
+ VersionAdded: "0.50"
862
861
  Include:
863
862
  - app/models/**/*.rb
864
863
 
@@ -867,36 +866,36 @@ Rails/HttpStatus:
867
866
  Enabled: true
868
867
  EnforcedStyle: symbolic
869
868
  SupportedStyles:
870
- - numeric
871
- - symbolic
869
+ - numeric
870
+ - symbolic
872
871
  StyleGuide: http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Rails/HttpStatus
873
872
 
874
873
  Rails/Output:
875
- Description: 'Checks for calls to puts, print, etc.'
874
+ Description: "Checks for calls to puts, print, etc."
876
875
  Enabled: true
877
876
 
878
877
  Rails/ReadWriteAttribute:
879
878
  Description: >-
880
- Checks for read_attribute(:attr) and
881
- write_attribute(:attr, val).
879
+ Checks for read_attribute(:attr) and
880
+ write_attribute(:attr, val).
882
881
  Enabled: false
883
882
 
884
883
  Rails/ScopeArgs:
885
- Description: 'Checks the arguments of ActiveRecord scopes.'
884
+ Description: "Checks the arguments of ActiveRecord scopes."
886
885
  Enabled: false
887
886
 
888
887
  Rails/SkipsModelValidations:
889
- Description: 'Checks for the use of ActiveRecord persistence methods that bypass model validations'
888
+ Description: "Checks for the use of ActiveRecord persistence methods that bypass model validations"
890
889
  Enabled: true
891
890
 
892
891
  Rails/TimeZone:
893
- Description: 'Checks the correct usage of time zone aware methods.'
894
- StyleGuide: 'https://github.com/bbatsov/rails-style-guide#time'
895
- Reference: 'http://danilenko.org/2012/7/6/rails_timezones'
892
+ Description: "Checks the correct usage of time zone aware methods."
893
+ StyleGuide: "https://github.com/bbatsov/rails-style-guide#time"
894
+ Reference: "http://danilenko.org/2012/7/6/rails_timezones"
896
895
  Enabled: false
897
896
 
898
897
  Rails/Validation:
899
- Description: 'Use validates :attribute, hash of validations.'
898
+ Description: "Use validates :attribute, hash of validations."
900
899
  Enabled: false
901
900
 
902
901
  RSpec/Capybara/CurrentPathExpectation:
@@ -920,8 +919,8 @@ RSpec/FactoryBot/CreateList:
920
919
  Enabled: false
921
920
  EnforcedStyle: create_list
922
921
  SupportedStyles:
923
- - create_list
924
- - n_times
922
+ - create_list
923
+ - n_times
925
924
  StyleGuide: http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/FactoryBot/CreateList
926
925
 
927
926
  # rubocop-rspec cops
@@ -960,18 +959,18 @@ RSpec/BeforeAfterAll:
960
959
  Description: Check that before/after(:all) isn't being used.
961
960
  Enabled: true
962
961
  Exclude:
963
- - spec/spec_helper.rb
964
- - spec/rails_helper.rb
965
- - spec/support/**/*.rb
962
+ - spec/spec_helper.rb
963
+ - spec/rails_helper.rb
964
+ - spec/support/**/*.rb
966
965
  StyleGuide: http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/BeforeAfterAll
967
966
 
968
967
  RSpec/ContextWording:
969
968
  Description: "`context` block descriptions should start with 'when', or 'with'."
970
969
  Enabled: false
971
970
  Prefixes:
972
- - when
973
- - with
974
- - without
971
+ - when
972
+ - with
973
+ - without
975
974
  StyleGuide: http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ContextWording
976
975
 
977
976
  RSpec/DescribeClass:
@@ -985,8 +984,8 @@ RSpec/DescribedClass:
985
984
  Enabled: false
986
985
  EnforcedStyle: described_class
987
986
  SupportedStyles:
988
- - described_class
989
- - explicit
987
+ - described_class
988
+ - explicit
990
989
  StyleGuide: http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/DescribedClass
991
990
 
992
991
  RSpec/DescribeMethod:
@@ -1040,9 +1039,9 @@ RSpec/ExampleWithoutDescription:
1040
1039
  Enabled: true
1041
1040
  EnforcedStyle: always_allow
1042
1041
  SupportedStyles:
1043
- - always_allow
1044
- - single_line_only
1045
- - disallow
1042
+ - always_allow
1043
+ - single_line_only
1044
+ - disallow
1046
1045
  StyleGuide: http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ExampleWithoutDescription
1047
1046
 
1048
1047
  RSpec/ExampleWording:
@@ -1060,7 +1059,7 @@ RSpec/ExpectActual:
1060
1059
  Description: Checks for `expect(...)` calls containing literal values.
1061
1060
  Enabled: true
1062
1061
  Exclude:
1063
- - spec/routing/**/*
1062
+ - spec/routing/**/*
1064
1063
  StyleGuide: http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ExpectActual
1065
1064
 
1066
1065
  RSpec/ExpectChange:
@@ -1068,8 +1067,8 @@ RSpec/ExpectChange:
1068
1067
  Enabled: true
1069
1068
  EnforcedStyle: method_call
1070
1069
  SupportedStyles:
1071
- - method_call
1072
- - block
1070
+ - method_call
1071
+ - block
1073
1072
  StyleGuide: http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ExpectChange
1074
1073
 
1075
1074
  RSpec/ExpectInHook:
@@ -1101,9 +1100,9 @@ RSpec/HookArgument:
1101
1100
  Enabled: true
1102
1101
  EnforcedStyle: implicit
1103
1102
  SupportedStyles:
1104
- - implicit
1105
- - each
1106
- - example
1103
+ - implicit
1104
+ - each
1105
+ - example
1107
1106
  StyleGuide: http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/HookArgument
1108
1107
 
1109
1108
  RSpec/HooksBeforeExamples:
@@ -1116,19 +1115,19 @@ RSpec/ImplicitExpect:
1116
1115
  Enabled: true
1117
1116
  EnforcedStyle: is_expected
1118
1117
  SupportedStyles:
1119
- - is_expected
1120
- - should
1118
+ - is_expected
1119
+ - should
1121
1120
  StyleGuide: http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ImplicitExpect
1122
1121
 
1123
1122
  RSpec/ImplicitSubject:
1124
1123
  Enabled: false
1125
1124
  Exclude:
1126
- - 'spec/controllers/**/*.rb'
1125
+ - "spec/controllers/**/*.rb"
1127
1126
  Description: Checks for usage of implicit subject (`is_expected` / `should`).
1128
1127
  EnforcedStyle: single_line_only
1129
1128
  SupportedStyles:
1130
- - single_line_only
1131
- - disallow
1129
+ - single_line_only
1130
+ - disallow
1132
1131
  StyleGuide: http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ImplicitSubject
1133
1132
 
1134
1133
  RSpec/InstanceSpy:
@@ -1147,8 +1146,8 @@ RSpec/ItBehavesLike:
1147
1146
  Enabled: true
1148
1147
  EnforcedStyle: it_behaves_like
1149
1148
  SupportedStyles:
1150
- - it_behaves_like
1151
- - it_should_behave_like
1149
+ - it_behaves_like
1150
+ - it_should_behave_like
1152
1151
  StyleGuide: http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ItBehavesLike
1153
1152
 
1154
1153
  RSpec/LeadingSubject:
@@ -1181,8 +1180,8 @@ RSpec/MessageExpectation:
1181
1180
  Enabled: false
1182
1181
  EnforcedStyle: allow
1183
1182
  SupportedStyles:
1184
- - allow
1185
- - expect
1183
+ - allow
1184
+ - expect
1186
1185
  StyleGuide: http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/MessageExpectation
1187
1186
 
1188
1187
  RSpec/MessageSpies:
@@ -1190,8 +1189,8 @@ RSpec/MessageSpies:
1190
1189
  Enabled: true
1191
1190
  EnforcedStyle: have_received
1192
1191
  SupportedStyles:
1193
- - have_received
1194
- - receive
1192
+ - have_received
1193
+ - receive
1195
1194
  StyleGuide: http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/MessageSpies
1196
1195
 
1197
1196
  RSpec/MissingExampleGroupArgument:
@@ -1234,8 +1233,8 @@ RSpec/NotToNot:
1234
1233
  Description: Checks for consistent method usage for negating expectations.
1235
1234
  EnforcedStyle: not_to
1236
1235
  SupportedStyles:
1237
- - not_to
1238
- - to_not
1236
+ - not_to
1237
+ - to_not
1239
1238
  Enabled: true
1240
1239
  StyleGuide: http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/NotToNot
1241
1240
 
@@ -1281,8 +1280,8 @@ RSpec/ReturnFromStub:
1281
1280
  Description: Checks for consistent style of stub's return setting.
1282
1281
  EnforcedStyle: and_return
1283
1282
  SupportedStyles:
1284
- - and_return
1285
- - block
1283
+ - and_return
1284
+ - block
1286
1285
  StyleGuide: http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ReturnFromStub
1287
1286
 
1288
1287
  RSpec/SharedContext: