rubocop-hixonrails 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 3e818345f68be81b288c9589985b44143fde06fb4e5b2218dd07416862d2dbf1
4
+ data.tar.gz: 78fe88c35be527514bf146960fce718cea0240536a46692fb9117e7dbbc894dc
5
+ SHA512:
6
+ metadata.gz: 004443bd240fb5b9872b5864c0a9aaf6749d14bffaa0784f6135ce0c582b32221f8acd6277977cb37e2543892898e1b4c37b5ad31b7674fd653c8a60b7410d2d
7
+ data.tar.gz: fd2a7d276e8e52e3ee65afbbc1a9659996d4bec0f740d741c04a4c44c290b21366430e601e05aef32211bfe2a05b9a96b8b03a7615861dc64438aab75127b9a4
@@ -0,0 +1,13 @@
1
+ inherit_from:
2
+ - .rubocop_todo.yml
3
+ - default.yml
4
+
5
+ Rails:
6
+ Enabled: false
7
+
8
+ RSpec:
9
+ Enabled: false
10
+
11
+ Style/StringHashKeys:
12
+ Exclude:
13
+ - 'lib/enabler/main.rb'
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require_relative '../lib/enabler/main'
5
+
6
+ Enabler::Main.run
7
+
8
+ # `bundle exec rubocop --auto-correct`
9
+ `bundle exec rubocop --auto-gen-config --auto-gen-only-exclude --exclude-limit 10000`
@@ -0,0 +1,3000 @@
1
+ ---
2
+ require:
3
+ - rubocop-performance
4
+ - rubocop-rails
5
+ - rubocop-rake
6
+ - rubocop-rspec
7
+ inherit_mode:
8
+ merge:
9
+ - Exclude
10
+ AllCops:
11
+ RSpec:
12
+ Patterns:
13
+ - _spec.rb
14
+ - "(?:^|/)spec/"
15
+ RSpec/FactoryBot:
16
+ Patterns:
17
+ - spec/factories.rb
18
+ - spec/factories/**/*.rb
19
+ - features/support/factories/**/*.rb
20
+ Exclude:
21
+ - tmp/**/*
22
+ - vendor/**/*
23
+ - script/**/*
24
+ - node_modules/**/*
25
+ Bundler/DuplicatedGem:
26
+ Description: Checks for duplicate gem entries in Gemfile.
27
+ Enabled: true
28
+ Include:
29
+ - "**/*.gemfile"
30
+ - "**/Gemfile"
31
+ - "**/gems.rb"
32
+ Bundler/GemComment:
33
+ Description: Add a comment describing each gem.
34
+ Enabled: false
35
+ Include:
36
+ - "**/*.gemfile"
37
+ - "**/Gemfile"
38
+ - "**/gems.rb"
39
+ IgnoredGems: []
40
+ OnlyFor: []
41
+ Bundler/InsecureProtocolSource:
42
+ Description: The source `:gemcutter`, `:rubygems` and `:rubyforge` are deprecated
43
+ because HTTP requests are insecure. Please change your source to 'https://rubygems.org'
44
+ if possible, or 'http://rubygems.org' if not.
45
+ Enabled: true
46
+ Include:
47
+ - "**/*.gemfile"
48
+ - "**/Gemfile"
49
+ - "**/gems.rb"
50
+ Bundler/OrderedGems:
51
+ Description: Gems within groups in the Gemfile should be alphabetically sorted.
52
+ Enabled: true
53
+ TreatCommentsAsGroupSeparators: true
54
+ ConsiderPunctuation: false
55
+ Include:
56
+ - "**/*.gemfile"
57
+ - "**/Gemfile"
58
+ - "**/gems.rb"
59
+ Capybara/CurrentPathExpectation:
60
+ Description: Checks that no expectations are set on Capybara's `current_path`.
61
+ Enabled: true
62
+ Capybara/FeatureMethods:
63
+ Description: Checks for consistent method usage in feature specs.
64
+ Enabled: true
65
+ EnabledMethods: []
66
+ Capybara/VisibilityMatcher:
67
+ Description: Checks for boolean visibility in capybara finders.
68
+ Enabled: true
69
+ FactoryBot/AttributeDefinedStatically:
70
+ Description: Always declare attribute values as blocks.
71
+ Enabled: true
72
+ FactoryBot/CreateList:
73
+ Description: Checks for create_list usage.
74
+ Enabled: true
75
+ EnforcedStyle: create_list
76
+ FactoryBot/FactoryClassName:
77
+ Description: Use string value when setting the class attribute explicitly.
78
+ Enabled: true
79
+ Gemspec/DuplicatedAssignment:
80
+ Description: An attribute assignment method calls should be listed only once in
81
+ a gemspec.
82
+ Enabled: true
83
+ Include:
84
+ - "**/*.gemspec"
85
+ Gemspec/OrderedDependencies:
86
+ Description: Dependencies in the gemspec should be alphabetically sorted.
87
+ Enabled: true
88
+ TreatCommentsAsGroupSeparators: true
89
+ ConsiderPunctuation: false
90
+ Include:
91
+ - "**/*.gemspec"
92
+ Gemspec/RequiredRubyVersion:
93
+ Description: Checks that `required_ruby_version` of gemspec is specified and equal
94
+ to `TargetRubyVersion` of .rubocop.yml.
95
+ Enabled: true
96
+ Include:
97
+ - "**/*.gemspec"
98
+ Gemspec/RubyVersionGlobalsUsage:
99
+ Description: Checks usage of RUBY_VERSION in gemspec.
100
+ Enabled: true
101
+ Include:
102
+ - "**/*.gemspec"
103
+ Layout/AccessModifierIndentation:
104
+ Description: Check indentation of private/protected visibility modifiers.
105
+ Enabled: true
106
+ EnforcedStyle: indent
107
+ IndentationWidth:
108
+ Layout/ArgumentAlignment:
109
+ Description: Align the arguments of a method call if they span more than one line.
110
+ Enabled: true
111
+ EnforcedStyle: with_first_argument
112
+ IndentationWidth:
113
+ Layout/ArrayAlignment:
114
+ Description: Align the elements of an array literal if they span more than one
115
+ line.
116
+ Enabled: true
117
+ EnforcedStyle: with_first_element
118
+ IndentationWidth:
119
+ Layout/AssignmentIndentation:
120
+ Description: Checks the indentation of the first line of the right-hand-side of
121
+ a multi-line assignment.
122
+ Enabled: true
123
+ IndentationWidth:
124
+ Layout/BlockAlignment:
125
+ Description: Align block ends correctly.
126
+ Enabled: true
127
+ EnforcedStyleAlignWith: either
128
+ SupportedStylesAlignWith:
129
+ - either
130
+ - start_of_block
131
+ - start_of_line
132
+ Layout/BlockEndNewline:
133
+ Description: Put end statement of multiline block on its own line.
134
+ Enabled: true
135
+ Layout/CaseIndentation:
136
+ Description: Indentation of when in a case/when/[else/]end.
137
+ Enabled: true
138
+ EnforcedStyle: case
139
+ IndentOneStep: false
140
+ IndentationWidth:
141
+ Layout/ClassStructure:
142
+ Description: Enforces a configured order of definitions within a class body.
143
+ Enabled: true
144
+ SafeAutoCorrect: false
145
+ Categories:
146
+ module_inclusion:
147
+ - extend
148
+ - prepend
149
+ - include
150
+ attribute_macros:
151
+ - attr_reader
152
+ - attr_writer
153
+ - attr_accessor
154
+ association:
155
+ - belongs_to
156
+ - has_one
157
+ - has_many
158
+ macros:
159
+ - public_constant
160
+ - private_constant
161
+ - act_as_paranoid
162
+ - commentable
163
+ - flag
164
+ - validates
165
+ - validate
166
+ ExpectedOrder:
167
+ - module_inclusion
168
+ - constants
169
+ - public_attribute_macros
170
+ - public_delegate
171
+ - association
172
+ - macros
173
+ - public_class_methods
174
+ - initializer
175
+ - public_methods
176
+ - protected_attribute_macros
177
+ - protected_delegate
178
+ - protected_methods
179
+ - private_attribute_macros
180
+ - private_delegate
181
+ - private_methods
182
+ Layout/ClosingHeredocIndentation:
183
+ Description: Checks the indentation of here document closings.
184
+ Enabled: true
185
+ Layout/ClosingParenthesisIndentation:
186
+ Description: Checks the indentation of hanging closing parentheses.
187
+ Enabled: true
188
+ Layout/CommentIndentation:
189
+ Description: Indentation of comments.
190
+ Enabled: true
191
+ Layout/ConditionPosition:
192
+ Description: Checks for condition placed in a confusing position relative to the
193
+ keyword.
194
+ Enabled: true
195
+ Layout/DefEndAlignment:
196
+ Description: Align ends corresponding to defs correctly.
197
+ Enabled: true
198
+ EnforcedStyleAlignWith: start_of_line
199
+ SupportedStylesAlignWith:
200
+ - start_of_line
201
+ - def
202
+ Severity: warning
203
+ Layout/DotPosition:
204
+ Description: Checks the position of the dot in multi-line method calls.
205
+ Enabled: true
206
+ EnforcedStyle: leading
207
+ Layout/ElseAlignment:
208
+ Description: Align elses and elsifs correctly.
209
+ Enabled: true
210
+ Layout/EmptyComment:
211
+ Description: Checks empty comment.
212
+ Enabled: true
213
+ AllowBorderComment: true
214
+ AllowMarginComment: true
215
+ Layout/EmptyLineAfterGuardClause:
216
+ Description: Add empty line after guard clause.
217
+ Enabled: true
218
+ Layout/EmptyLineAfterMagicComment:
219
+ Description: Add an empty line after magic comments to separate them from code.
220
+ Enabled: true
221
+ Layout/EmptyLineAfterMultilineCondition:
222
+ Description: Enforces empty line after multiline condition.
223
+ Enabled: true
224
+ Reference:
225
+ - https://github.com/airbnb/ruby#multiline-if-newline
226
+ Layout/EmptyLineBetweenDefs:
227
+ Description: Use empty lines between defs.
228
+ Enabled: true
229
+ AllowAdjacentOneLineDefs: false
230
+ NumberOfEmptyLines: 1
231
+ Layout/EmptyLines:
232
+ Description: Don't use several empty lines in a row.
233
+ Enabled: true
234
+ Layout/EmptyLinesAroundAccessModifier:
235
+ Description: Keep blank lines around access modifiers.
236
+ Enabled: true
237
+ EnforcedStyle: around
238
+ Reference:
239
+ - https://edgeguides.rubyonrails.org/contributing_to_ruby_on_rails.html#follow-the-coding-conventions
240
+ Layout/EmptyLinesAroundArguments:
241
+ Description: Keeps track of empty lines around method arguments.
242
+ Enabled: true
243
+ Layout/EmptyLinesAroundAttributeAccessor:
244
+ Description: Keep blank lines around attribute accessors.
245
+ Enabled: true
246
+ AllowAliasSyntax: true
247
+ AllowedMethods:
248
+ - alias_method
249
+ - public
250
+ - protected
251
+ - private
252
+ Layout/EmptyLinesAroundBeginBody:
253
+ Description: Keeps track of empty lines around begin-end bodies.
254
+ Enabled: true
255
+ Layout/EmptyLinesAroundBlockBody:
256
+ Description: Keeps track of empty lines around block bodies.
257
+ Enabled: true
258
+ EnforcedStyle: no_empty_lines
259
+ Layout/EmptyLinesAroundClassBody:
260
+ Description: Keeps track of empty lines around class bodies.
261
+ Enabled: true
262
+ EnforcedStyle: no_empty_lines
263
+ Layout/EmptyLinesAroundExceptionHandlingKeywords:
264
+ Description: Keeps track of empty lines around exception handling keywords.
265
+ Enabled: true
266
+ Layout/EmptyLinesAroundMethodBody:
267
+ Description: Keeps track of empty lines around method bodies.
268
+ Enabled: true
269
+ Layout/EmptyLinesAroundModuleBody:
270
+ Description: Keeps track of empty lines around module bodies.
271
+ Enabled: true
272
+ EnforcedStyle: no_empty_lines
273
+ Layout/EndAlignment:
274
+ Description: Align ends correctly.
275
+ Enabled: true
276
+ EnforcedStyleAlignWith: keyword
277
+ SupportedStylesAlignWith:
278
+ - keyword
279
+ - variable
280
+ - start_of_line
281
+ Severity: warning
282
+ Layout/EndOfLine:
283
+ Description: Use Unix-style line endings.
284
+ Enabled: true
285
+ EnforcedStyle: native
286
+ Layout/ExtraSpacing:
287
+ Description: Do not use unnecessary spacing.
288
+ Enabled: true
289
+ AllowForAlignment: true
290
+ AllowBeforeTrailingComments: false
291
+ ForceEqualSignAlignment: false
292
+ Layout/FirstArgumentIndentation:
293
+ Description: Checks the indentation of the first argument in a method call.
294
+ Enabled: true
295
+ EnforcedStyle: special_for_inner_method_call_in_parentheses
296
+ IndentationWidth:
297
+ Layout/FirstArrayElementIndentation:
298
+ Description: Checks the indentation of the first element in an array literal.
299
+ Enabled: true
300
+ EnforcedStyle: special_inside_parentheses
301
+ IndentationWidth:
302
+ Layout/FirstArrayElementLineBreak:
303
+ Description: Checks for a line break before the first element in a multi-line
304
+ array.
305
+ Enabled: true
306
+ Layout/FirstHashElementIndentation:
307
+ Description: Checks the indentation of the first key in a hash literal.
308
+ Enabled: true
309
+ EnforcedStyle: special_inside_parentheses
310
+ IndentationWidth:
311
+ Layout/FirstHashElementLineBreak:
312
+ Description: Checks for a line break before the first element in a multi-line
313
+ hash.
314
+ Enabled: true
315
+ Layout/FirstMethodArgumentLineBreak:
316
+ Description: Checks for a line break before the first argument in a multi-line
317
+ method call.
318
+ Enabled: true
319
+ Layout/FirstMethodParameterLineBreak:
320
+ Description: Checks for a line break before the first parameter in a multi-line
321
+ method parameter definition.
322
+ Enabled: true
323
+ Layout/FirstParameterIndentation:
324
+ Description: Checks the indentation of the first parameter in a method definition.
325
+ Enabled: true
326
+ EnforcedStyle: consistent
327
+ IndentationWidth:
328
+ Layout/HashAlignment:
329
+ Description: Align the elements of a hash literal if they span more than one line.
330
+ Enabled: true
331
+ AllowMultipleStyles: true
332
+ EnforcedHashRocketStyle: key
333
+ SupportedHashRocketStyles:
334
+ - key
335
+ - separator
336
+ - table
337
+ EnforcedColonStyle: key
338
+ SupportedColonStyles:
339
+ - key
340
+ - separator
341
+ - table
342
+ EnforcedLastArgumentHashStyle: always_inspect
343
+ SupportedLastArgumentHashStyles:
344
+ - always_inspect
345
+ - always_ignore
346
+ - ignore_implicit
347
+ - ignore_explicit
348
+ Layout/HeredocArgumentClosingParenthesis:
349
+ Description: Checks for the placement of the closing parenthesis in a method call
350
+ that passes a HEREDOC string as an argument.
351
+ Enabled: false
352
+ Layout/HeredocIndentation:
353
+ Description: This cop checks the indentation of the here document bodies.
354
+ Enabled: true
355
+ Layout/IndentationConsistency:
356
+ Description: Keep indentation straight.
357
+ Enabled: true
358
+ EnforcedStyle: normal
359
+ Reference:
360
+ - https://edgeguides.rubyonrails.org/contributing_to_ruby_on_rails.html#follow-the-coding-conventions
361
+ Layout/IndentationStyle:
362
+ Description: Consistent indentation either with tabs only or spaces only.
363
+ Enabled: true
364
+ IndentationWidth:
365
+ EnforcedStyle: spaces
366
+ Layout/IndentationWidth:
367
+ Description: Use 2 spaces for indentation.
368
+ Enabled: true
369
+ Width: 2
370
+ IgnoredPatterns: []
371
+ Layout/InitialIndentation:
372
+ Description: Checks the indentation of the first non-blank non-comment line in
373
+ a file.
374
+ Enabled: true
375
+ Layout/LeadingCommentSpace:
376
+ Description: Comments should start with a space.
377
+ Enabled: true
378
+ AllowDoxygenCommentStyle: false
379
+ AllowGemfileRubyComment: false
380
+ Layout/LeadingEmptyLines:
381
+ Description: Check for unnecessary blank lines at the beginning of a file.
382
+ Enabled: true
383
+ Layout/LineLength:
384
+ Description: Checks that line length does not exceed the configured limit.
385
+ Enabled: true
386
+ AutoCorrect: false
387
+ Max: 120
388
+ AllowHeredoc: true
389
+ AllowURI: true
390
+ URISchemes:
391
+ - http
392
+ - https
393
+ IgnoreCopDirectives: true
394
+ IgnoredPatterns: []
395
+ Layout/MultilineArrayBraceLayout:
396
+ Description: Checks that the closing brace in an array literal is either on the
397
+ same line as the last array element, or a new line.
398
+ Enabled: true
399
+ EnforcedStyle: symmetrical
400
+ Layout/MultilineArrayLineBreaks:
401
+ Description: Checks that each item in a multi-line array literal starts on a separate
402
+ line.
403
+ Enabled: true
404
+ Layout/MultilineAssignmentLayout:
405
+ Description: Check for a newline after the assignment operator in multi-line assignments.
406
+ Enabled: true
407
+ SupportedTypes:
408
+ - block
409
+ - case
410
+ - class
411
+ - if
412
+ - kwbegin
413
+ - module
414
+ EnforcedStyle: same_line
415
+ Layout/MultilineBlockLayout:
416
+ Description: Ensures newlines after multiline block do statements.
417
+ Enabled: true
418
+ Layout/MultilineHashBraceLayout:
419
+ Description: Checks that the closing brace in a hash literal is either on the
420
+ same line as the last hash element, or a new line.
421
+ Enabled: true
422
+ EnforcedStyle: symmetrical
423
+ Layout/MultilineHashKeyLineBreaks:
424
+ Description: Checks that each item in a multi-line hash literal starts on a separate
425
+ line.
426
+ Enabled: true
427
+ Layout/MultilineMethodArgumentLineBreaks:
428
+ Description: Checks that each argument in a multi-line method call starts on a
429
+ separate line.
430
+ Enabled: true
431
+ Layout/MultilineMethodCallBraceLayout:
432
+ Description: Checks that the closing brace in a method call is either on the same
433
+ line as the last method argument, or a new line.
434
+ Enabled: true
435
+ EnforcedStyle: symmetrical
436
+ Layout/MultilineMethodCallIndentation:
437
+ Description: Checks indentation of method calls with the dot operator that span
438
+ more than one line.
439
+ Enabled: true
440
+ EnforcedStyle: aligned
441
+ IndentationWidth:
442
+ Layout/MultilineMethodDefinitionBraceLayout:
443
+ Description: Checks that the closing brace in a method definition is either on
444
+ the same line as the last method parameter, or a new line.
445
+ Enabled: true
446
+ EnforcedStyle: symmetrical
447
+ Layout/MultilineOperationIndentation:
448
+ Description: Checks indentation of binary operations that span more than one line.
449
+ Enabled: true
450
+ EnforcedStyle: aligned
451
+ IndentationWidth:
452
+ Layout/ParameterAlignment:
453
+ Description: Align the parameters of a method definition if they span more than
454
+ one line.
455
+ Enabled: true
456
+ EnforcedStyle: with_first_parameter
457
+ IndentationWidth:
458
+ Layout/RescueEnsureAlignment:
459
+ Description: Align rescues and ensures correctly.
460
+ Enabled: true
461
+ Layout/SpaceAfterColon:
462
+ Description: Use spaces after colons.
463
+ Enabled: true
464
+ Layout/SpaceAfterComma:
465
+ Description: Use spaces after commas.
466
+ Enabled: true
467
+ Layout/SpaceAfterMethodName:
468
+ Description: Do not put a space between a method name and the opening parenthesis
469
+ in a method definition.
470
+ Enabled: true
471
+ Layout/SpaceAfterNot:
472
+ Description: Tracks redundant space after the ! operator.
473
+ Enabled: true
474
+ Layout/SpaceAfterSemicolon:
475
+ Description: Use spaces after semicolons.
476
+ Enabled: true
477
+ Layout/SpaceAroundBlockParameters:
478
+ Description: Checks the spacing inside and after block parameters pipes.
479
+ Enabled: true
480
+ EnforcedStyleInsidePipes: no_space
481
+ SupportedStylesInsidePipes:
482
+ - space
483
+ - no_space
484
+ Layout/SpaceAroundEqualsInParameterDefault:
485
+ Description: Checks that the equals signs in parameter default assignments have
486
+ or don't have surrounding space depending on configuration.
487
+ Enabled: true
488
+ EnforcedStyle: space
489
+ Layout/SpaceAroundKeyword:
490
+ Description: Use a space around keywords if appropriate.
491
+ Enabled: true
492
+ Layout/SpaceAroundMethodCallOperator:
493
+ Description: Checks method call operators to not have spaces around them.
494
+ Enabled: true
495
+ Layout/SpaceAroundOperators:
496
+ Description: Use a single space around operators.
497
+ Enabled: true
498
+ AllowForAlignment: true
499
+ EnforcedStyleForExponentOperator: no_space
500
+ SupportedStylesForExponentOperator:
501
+ - space
502
+ - no_space
503
+ Layout/SpaceBeforeBlockBraces:
504
+ Description: Checks that the left block brace has or doesn't have space before
505
+ it.
506
+ Enabled: true
507
+ EnforcedStyle: space
508
+ EnforcedStyleForEmptyBraces: space
509
+ SupportedStylesForEmptyBraces:
510
+ - space
511
+ - no_space
512
+ Layout/SpaceBeforeComma:
513
+ Description: No spaces before commas.
514
+ Enabled: true
515
+ Layout/SpaceBeforeComment:
516
+ Description: Checks for missing space between code and a comment on the same line.
517
+ Enabled: true
518
+ Layout/SpaceBeforeFirstArg:
519
+ Description: Checks that exactly one space is used between a method name and the
520
+ first argument for method calls without parentheses.
521
+ Enabled: true
522
+ AllowForAlignment: true
523
+ Layout/SpaceBeforeSemicolon:
524
+ Description: No spaces before semicolons.
525
+ Enabled: true
526
+ Layout/SpaceInLambdaLiteral:
527
+ Description: Checks for spaces in lambda literals.
528
+ Enabled: true
529
+ EnforcedStyle: require_no_space
530
+ Layout/SpaceInsideArrayLiteralBrackets:
531
+ Description: Checks the spacing inside array literal brackets.
532
+ Enabled: true
533
+ EnforcedStyle: no_space
534
+ EnforcedStyleForEmptyBrackets: no_space
535
+ SupportedStylesForEmptyBrackets:
536
+ - space
537
+ - no_space
538
+ Layout/SpaceInsideArrayPercentLiteral:
539
+ Description: No unnecessary additional spaces between elements in %i/%w literals.
540
+ Enabled: true
541
+ Layout/SpaceInsideBlockBraces:
542
+ Description: Checks that block braces have or don't have surrounding space. For
543
+ blocks taking parameters, checks that the left brace has or doesn't have trailing
544
+ space.
545
+ Enabled: true
546
+ EnforcedStyle: space
547
+ EnforcedStyleForEmptyBraces: no_space
548
+ SupportedStylesForEmptyBraces:
549
+ - space
550
+ - no_space
551
+ SpaceBeforeBlockParameters: true
552
+ Layout/SpaceInsideHashLiteralBraces:
553
+ Description: Use spaces inside hash literal braces - or don't.
554
+ Enabled: true
555
+ EnforcedStyle: space
556
+ EnforcedStyleForEmptyBraces: no_space
557
+ SupportedStylesForEmptyBraces:
558
+ - space
559
+ - no_space
560
+ Layout/SpaceInsideParens:
561
+ Description: No spaces after ( or before ).
562
+ Enabled: true
563
+ EnforcedStyle: no_space
564
+ Layout/SpaceInsidePercentLiteralDelimiters:
565
+ Description: No unnecessary spaces inside delimiters of %i/%w/%x literals.
566
+ Enabled: true
567
+ Layout/SpaceInsideRangeLiteral:
568
+ Description: No spaces inside range literals.
569
+ Enabled: true
570
+ Layout/SpaceInsideReferenceBrackets:
571
+ Description: Checks the spacing inside referential brackets.
572
+ Enabled: true
573
+ EnforcedStyle: no_space
574
+ EnforcedStyleForEmptyBrackets: no_space
575
+ SupportedStylesForEmptyBrackets:
576
+ - space
577
+ - no_space
578
+ Layout/SpaceInsideStringInterpolation:
579
+ Description: Checks for padding/surrounding spaces inside string interpolation.
580
+ Enabled: true
581
+ EnforcedStyle: no_space
582
+ Layout/TrailingEmptyLines:
583
+ Description: Checks trailing blank lines and final newline.
584
+ Enabled: true
585
+ EnforcedStyle: final_newline
586
+ Layout/TrailingWhitespace:
587
+ Description: Avoid trailing whitespace.
588
+ Enabled: true
589
+ AllowInHeredoc: true
590
+ Lint/AmbiguousBlockAssociation:
591
+ Description: Checks for ambiguous block association with method when param passed
592
+ without parentheses.
593
+ Enabled: true
594
+ Exclude:
595
+ - spec/**/*
596
+ Lint/AmbiguousOperator:
597
+ Description: Checks for ambiguous operators in the first argument of a method
598
+ invocation without parentheses.
599
+ Enabled: true
600
+ Lint/AmbiguousRegexpLiteral:
601
+ Description: Checks for ambiguous regexp literals in the first argument of a method
602
+ invocation without parentheses.
603
+ Enabled: true
604
+ Lint/AssignmentInCondition:
605
+ Description: Don't use assignment in conditions.
606
+ Enabled: true
607
+ AllowSafeAssignment: true
608
+ Lint/BigDecimalNew:
609
+ Description: "`BigDecimal.new()` is deprecated. Use `BigDecimal()` instead."
610
+ Enabled: true
611
+ Lint/BinaryOperatorWithIdenticalOperands:
612
+ Description: This cop checks for places where binary operator has identical operands.
613
+ Enabled: true
614
+ Safe: false
615
+ Lint/BooleanSymbol:
616
+ Description: Check for `:true` and `:false` symbols.
617
+ Enabled: true
618
+ Safe: false
619
+ Lint/CircularArgumentReference:
620
+ Description: Default values in optional keyword arguments and optional ordinal
621
+ arguments should not refer back to the name of the argument.
622
+ Enabled: true
623
+ Lint/ConstantResolution:
624
+ Description: Check that constants are fully qualified with `::`.
625
+ Enabled: false
626
+ Only: []
627
+ Ignore: []
628
+ Lint/Debugger:
629
+ Description: Check for debugger calls.
630
+ Enabled: true
631
+ Lint/DeprecatedClassMethods:
632
+ Description: Check for deprecated class method calls.
633
+ Enabled: true
634
+ Lint/DeprecatedOpenSSLConstant:
635
+ Description: Don't use algorithm constants for `OpenSSL::Cipher` and `OpenSSL::Digest`.
636
+ Enabled: true
637
+ Lint/DisjunctiveAssignmentInConstructor:
638
+ Description: In constructor, plain assignment is preferred over disjunctive.
639
+ Enabled: true
640
+ Safe: false
641
+ Lint/DuplicateCaseCondition:
642
+ Description: Do not repeat values in case conditionals.
643
+ Enabled: true
644
+ Lint/DuplicateElsifCondition:
645
+ Description: Do not repeat conditions used in if `elsif`.
646
+ Enabled: true
647
+ Lint/DuplicateHashKey:
648
+ Description: Check for duplicate keys in hash literals.
649
+ Enabled: true
650
+ Lint/DuplicateMethods:
651
+ Description: Check for duplicate method definitions.
652
+ Enabled: true
653
+ Lint/DuplicateRequire:
654
+ Description: Check for duplicate `require`s and `require_relative`s.
655
+ Enabled: true
656
+ Lint/DuplicateRescueException:
657
+ Description: Checks that there are no repeated exceptions used in `rescue` expressions.
658
+ Enabled: true
659
+ Lint/EachWithObjectArgument:
660
+ Description: Check for immutable argument given to each_with_object.
661
+ Enabled: true
662
+ Lint/ElseLayout:
663
+ Description: Check for odd code arrangement in an else block.
664
+ Enabled: true
665
+ Lint/EmptyConditionalBody:
666
+ Description: This cop checks for the presence of `if`, `elsif` and `unless` branches
667
+ without a body.
668
+ Enabled: true
669
+ AllowComments: true
670
+ Lint/EmptyEnsure:
671
+ Description: Checks for empty ensure block.
672
+ Enabled: true
673
+ Lint/EmptyExpression:
674
+ Description: Checks for empty expressions.
675
+ Enabled: true
676
+ Lint/EmptyFile:
677
+ Description: Enforces that Ruby source files are not empty.
678
+ Enabled: true
679
+ AllowComments: true
680
+ Lint/EmptyInterpolation:
681
+ Description: Checks for empty string interpolation.
682
+ Enabled: true
683
+ Lint/EmptyWhen:
684
+ Description: Checks for `when` branches with empty bodies.
685
+ Enabled: true
686
+ AllowComments: true
687
+ Lint/EnsureReturn:
688
+ Description: Do not use return in an ensure block.
689
+ Enabled: true
690
+ Lint/ErbNewArguments:
691
+ Description: Use `:trim_mode` and `:eoutvar` keyword arguments to `ERB.new`.
692
+ Enabled: true
693
+ Lint/FlipFlop:
694
+ Description: Checks for flip-flops.
695
+ Enabled: true
696
+ Lint/FloatComparison:
697
+ Description: Checks for the presence of precise comparison of floating point numbers.
698
+ Enabled: true
699
+ Lint/FloatOutOfRange:
700
+ Description: Catches floating-point literals too large or small for Ruby to represent.
701
+ Enabled: true
702
+ Lint/FormatParameterMismatch:
703
+ Description: The number of parameters to format/sprint must match the fields.
704
+ Enabled: true
705
+ Lint/HeredocMethodCallPosition:
706
+ Description: Checks for the ordering of a method call where the receiver of the
707
+ call is a HEREDOC.
708
+ Enabled: false
709
+ Lint/ImplicitStringConcatenation:
710
+ Description: Checks for adjacent string literals on the same line, which could
711
+ better be represented as a single string literal.
712
+ Enabled: true
713
+ Lint/IneffectiveAccessModifier:
714
+ Description: Checks for attempts to use `private` or `protected` to set the visibility
715
+ of a class method, which does not work.
716
+ Enabled: true
717
+ Lint/InheritException:
718
+ Description: Avoid inheriting from the `Exception` class.
719
+ Enabled: true
720
+ EnforcedStyle: runtime_error
721
+ Lint/InterpolationCheck:
722
+ Description: Raise warning for interpolation in single q strs.
723
+ Enabled: true
724
+ Safe: false
725
+ Lint/LiteralAsCondition:
726
+ Description: Checks of literals used in conditions.
727
+ Enabled: true
728
+ Lint/LiteralInInterpolation:
729
+ Description: Checks for literals used in interpolation.
730
+ Enabled: true
731
+ Lint/Loop:
732
+ Description: Use Kernel#loop with break rather than begin/end/until or begin/end/while
733
+ for post-loop tests.
734
+ Enabled: true
735
+ Lint/MissingCopEnableDirective:
736
+ Description: Checks for a `# rubocop:enable` after `# rubocop:disable`.
737
+ Enabled: true
738
+ MaximumRangeSize: .inf
739
+ Lint/MissingSuper:
740
+ Description: This cop checks for the presence of constructors and lifecycle callbacks
741
+ without calls to `super`'.
742
+ Enabled: true
743
+ Lint/MixedRegexpCaptureTypes:
744
+ Description: Do not mix named captures and numbered captures in a Regexp literal.
745
+ Enabled: true
746
+ Lint/MultipleComparison:
747
+ Description: Use `&&` operator to compare multiple values.
748
+ Enabled: true
749
+ Lint/NestedMethodDefinition:
750
+ Description: Do not use nested method definitions.
751
+ Enabled: true
752
+ Lint/NestedPercentLiteral:
753
+ Description: Checks for nested percent literals.
754
+ Enabled: true
755
+ Lint/NextWithoutAccumulator:
756
+ Description: Do not omit the accumulator when calling `next` in a `reduce`/`inject`
757
+ block.
758
+ Enabled: true
759
+ Lint/NonDeterministicRequireOrder:
760
+ Description: Always sort arrays returned by Dir.glob when requiring files.
761
+ Enabled: true
762
+ Safe: false
763
+ Lint/NonLocalExitFromIterator:
764
+ Description: Do not use return in iterator to cause non-local exit.
765
+ Enabled: true
766
+ Lint/NumberConversion:
767
+ Description: Checks unsafe usage of number conversion methods.
768
+ Enabled: true
769
+ SafeAutoCorrect: false
770
+ Lint/OrderedMagicComments:
771
+ Description: Checks the proper ordering of magic comments and whether a magic
772
+ comment is not placed before a shebang.
773
+ Enabled: true
774
+ Lint/OutOfRangeRegexpRef:
775
+ Description: Checks for out of range reference for Regexp because it always returns
776
+ nil.
777
+ Enabled: true
778
+ Safe: false
779
+ Lint/ParenthesesAsGroupedExpression:
780
+ Description: Checks for method calls with a space before the opening parenthesis.
781
+ Enabled: true
782
+ Lint/PercentStringArray:
783
+ Description: Checks for unwanted commas and quotes in %w/%W literals.
784
+ Enabled: true
785
+ Safe: false
786
+ Lint/PercentSymbolArray:
787
+ Description: Checks for unwanted commas and colons in %i/%I literals.
788
+ Enabled: true
789
+ Lint/RaiseException:
790
+ Description: Checks for `raise` or `fail` statements which are raising `Exception`
791
+ class.
792
+ Enabled: true
793
+ Safe: false
794
+ AllowedImplicitNamespaces:
795
+ - Gem
796
+ Lint/RandOne:
797
+ Description: Checks for `rand(1)` calls. Such calls always return `0` and most
798
+ likely a mistake.
799
+ Enabled: true
800
+ Lint/RedundantCopDisableDirective:
801
+ Description: 'Checks for rubocop:disable comments that can be removed. Note: this
802
+ cop is not disabled when disabling all cops. It must be explicitly disabled.'
803
+ Enabled: true
804
+ Lint/RedundantCopEnableDirective:
805
+ Description: Checks for rubocop:enable comments that can be removed.
806
+ Enabled: true
807
+ Lint/RedundantRequireStatement:
808
+ Description: Checks for unnecessary `require` statement.
809
+ Enabled: true
810
+ Lint/RedundantSplatExpansion:
811
+ Description: Checks for splat unnecessarily being called on literals.
812
+ Enabled: true
813
+ Lint/RedundantStringCoercion:
814
+ Description: Checks for Object#to_s usage in string interpolation.
815
+ Enabled: true
816
+ Lint/RedundantWithIndex:
817
+ Description: Checks for redundant `with_index`.
818
+ Enabled: true
819
+ Lint/RedundantWithObject:
820
+ Description: Checks for redundant `with_object`.
821
+ Enabled: true
822
+ Lint/RegexpAsCondition:
823
+ Description: Do not use regexp literal as a condition. The regexp literal matches
824
+ `$_` implicitly.
825
+ Enabled: true
826
+ Lint/RequireParentheses:
827
+ Description: Use parentheses in the method call to avoid confusion about precedence.
828
+ Enabled: true
829
+ Lint/RescueException:
830
+ Description: Avoid rescuing the Exception class.
831
+ Enabled: true
832
+ Lint/RescueType:
833
+ Description: Avoid rescuing from non constants that could result in a `TypeError`.
834
+ Enabled: true
835
+ Lint/ReturnInVoidContext:
836
+ Description: Checks for return in void context.
837
+ Enabled: true
838
+ Lint/SafeNavigationChain:
839
+ Description: Do not chain ordinary method call after safe navigation operator.
840
+ Enabled: true
841
+ AllowedMethods:
842
+ - present?
843
+ - blank?
844
+ - presence
845
+ - try
846
+ - try!
847
+ Lint/SafeNavigationConsistency:
848
+ Description: Check to make sure that if safe navigation is used for a method call
849
+ in an `&&` or `||` condition that safe navigation is used for all method calls
850
+ on that same object.
851
+ Enabled: true
852
+ AllowedMethods:
853
+ - present?
854
+ - blank?
855
+ - presence
856
+ - try
857
+ - try!
858
+ Lint/SafeNavigationWithEmpty:
859
+ Description: Avoid `foo&.empty?` in conditionals.
860
+ Enabled: true
861
+ Lint/ScriptPermission:
862
+ Description: Grant script file execute permission.
863
+ Enabled: true
864
+ Lint/SelfAssignment:
865
+ Description: Checks for self-assignments.
866
+ Enabled: true
867
+ Lint/SendWithMixinArgument:
868
+ Description: Checks for `send` method when using mixin.
869
+ Enabled: true
870
+ Lint/ShadowedArgument:
871
+ Description: Avoid reassigning arguments before they were used.
872
+ Enabled: true
873
+ IgnoreImplicitReferences: false
874
+ Lint/ShadowedException:
875
+ Description: Avoid rescuing a higher level exception before a lower level exception.
876
+ Enabled: true
877
+ Lint/ShadowingOuterLocalVariable:
878
+ Description: Do not use the same name as outer local variable for block arguments
879
+ or block local variables.
880
+ Enabled: true
881
+ Lint/StructNewOverride:
882
+ Description: Disallow overriding the `Struct` built-in methods via `Struct.new`.
883
+ Enabled: true
884
+ Lint/SuppressedException:
885
+ Description: Don't suppress exceptions.
886
+ Enabled: true
887
+ AllowComments: true
888
+ Lint/Syntax:
889
+ Description: Checks syntax error.
890
+ Enabled: true
891
+ Lint/ToJSON:
892
+ Description: 'Ensure #to_json includes an optional argument.'
893
+ Enabled: true
894
+ Lint/TopLevelReturnWithArgument:
895
+ Description: This cop detects top level return statements with argument.
896
+ Enabled: true
897
+ Lint/TrailingCommaInAttributeDeclaration:
898
+ Description: This cop checks for trailing commas in attribute declarations.
899
+ Enabled: true
900
+ Lint/UnderscorePrefixedVariableName:
901
+ Description: Do not use prefix `_` for a variable that is used.
902
+ Enabled: true
903
+ AllowKeywordBlockArguments: false
904
+ Lint/UnifiedInteger:
905
+ Description: Use Integer instead of Fixnum or Bignum.
906
+ Enabled: true
907
+ Lint/UnreachableCode:
908
+ Description: Unreachable code.
909
+ Enabled: true
910
+ Lint/UnreachableLoop:
911
+ Description: This cop checks for loops that will have at most one iteration.
912
+ Enabled: true
913
+ Lint/UnusedBlockArgument:
914
+ Description: Checks for unused block arguments.
915
+ Enabled: true
916
+ IgnoreEmptyBlocks: true
917
+ AllowUnusedKeywordArguments: false
918
+ Lint/UnusedMethodArgument:
919
+ Description: Checks for unused method arguments.
920
+ Enabled: true
921
+ AllowUnusedKeywordArguments: false
922
+ IgnoreEmptyMethods: true
923
+ IgnoreNotImplementedMethods: true
924
+ Lint/UriEscapeUnescape:
925
+ Description: "`URI.escape` method is obsolete and should not be used. Instead,
926
+ use `CGI.escape`, `URI.encode_www_form` or `URI.encode_www_form_component`
927
+ depending on your specific use case. Also `URI.unescape` method is obsolete
928
+ and should not be used. Instead, use `CGI.unescape`, `URI.decode_www_form`
929
+ or `URI.decode_www_form_component` depending on your specific use case."
930
+ Enabled: true
931
+ Lint/UriRegexp:
932
+ Description: Use `URI::DEFAULT_PARSER.make_regexp` instead of `URI.regexp`.
933
+ Enabled: true
934
+ Lint/UselessAccessModifier:
935
+ Description: Checks for useless access modifiers.
936
+ Enabled: true
937
+ ContextCreatingMethods: []
938
+ MethodCreatingMethods: []
939
+ Lint/UselessAssignment:
940
+ Description: Checks for useless assignment to a local variable.
941
+ Enabled: true
942
+ Lint/UselessElseWithoutRescue:
943
+ Description: Checks for useless `else` in `begin..end` without `rescue`.
944
+ Enabled: true
945
+ Lint/UselessMethodDefinition:
946
+ Description: Checks for useless method definitions.
947
+ Enabled: true
948
+ Safe: false
949
+ AllowComments: true
950
+ Lint/UselessSetterCall:
951
+ Description: Checks for useless setter call to a local variable.
952
+ Enabled: true
953
+ Safe: false
954
+ Lint/Void:
955
+ Description: Possible use of operator/literal/variable in void context.
956
+ Enabled: true
957
+ CheckForMethodsWithNoSideEffects: false
958
+ Metrics/AbcSize:
959
+ Description: A calculated magnitude based on number of assignments, branches,
960
+ and conditions.
961
+ Reference:
962
+ - http://c2.com/cgi/wiki?AbcMetric
963
+ - https://en.wikipedia.org/wiki/ABC_Software_Metric
964
+ Enabled: true
965
+ IgnoredMethods: []
966
+ Max: 25
967
+ Metrics/BlockLength:
968
+ Description: Avoid long blocks with many lines.
969
+ Enabled: true
970
+ CountComments: false
971
+ Max: 25
972
+ CountAsOne: []
973
+ ExcludedMethods:
974
+ - refine
975
+ Exclude:
976
+ - spec/**/*
977
+ Metrics/BlockNesting:
978
+ Description: Avoid excessive block nesting.
979
+ Enabled: true
980
+ CountBlocks: false
981
+ Max: 3
982
+ Metrics/ClassLength:
983
+ Description: Avoid classes longer than 100 lines of code.
984
+ Enabled: true
985
+ CountComments: false
986
+ Max: 100
987
+ CountAsOne: []
988
+ Metrics/CyclomaticComplexity:
989
+ Description: A complexity metric that is strongly correlated to the number of
990
+ test cases needed to validate a method.
991
+ Enabled: true
992
+ IgnoredMethods: []
993
+ Max: 6
994
+ Metrics/MethodLength:
995
+ Description: Avoid methods longer than 10 lines of code.
996
+ Enabled: true
997
+ CountComments: false
998
+ Max: 15
999
+ CountAsOne: []
1000
+ ExcludedMethods: []
1001
+ Metrics/ModuleLength:
1002
+ Description: Avoid modules longer than 100 lines of code.
1003
+ Enabled: true
1004
+ CountComments: false
1005
+ Max: 100
1006
+ CountAsOne: []
1007
+ Metrics/ParameterLists:
1008
+ Description: Avoid parameter lists longer than three or four parameters.
1009
+ Enabled: true
1010
+ Max: 5
1011
+ CountKeywordArgs: true
1012
+ Metrics/PerceivedComplexity:
1013
+ Description: A complexity metric geared towards measuring complexity for a human
1014
+ reader.
1015
+ Enabled: true
1016
+ IgnoredMethods: []
1017
+ Max: 8
1018
+ Migration/DepartmentName:
1019
+ Description: Check that cop names in rubocop:disable (etc) comments are given
1020
+ with department name.
1021
+ Enabled: true
1022
+ Naming/AccessorMethodName:
1023
+ Description: Check the naming of accessor methods for get_/set_.
1024
+ Enabled: true
1025
+ Naming/AsciiIdentifiers:
1026
+ Description: Use only ascii symbols in identifiers and constants.
1027
+ Enabled: true
1028
+ AsciiConstants: true
1029
+ Naming/BinaryOperatorParameterName:
1030
+ Description: When defining binary operators, name the argument other.
1031
+ Enabled: true
1032
+ Naming/BlockParameterName:
1033
+ Description: Checks for block parameter names that contain capital letters, end
1034
+ in numbers, or do not meet a minimal length.
1035
+ Enabled: true
1036
+ MinNameLength: 1
1037
+ AllowNamesEndingInNumbers: true
1038
+ AllowedNames: []
1039
+ ForbiddenNames: []
1040
+ Naming/ClassAndModuleCamelCase:
1041
+ Description: Use CamelCase for classes and modules.
1042
+ Enabled: true
1043
+ AllowedNames:
1044
+ - module_parent
1045
+ Naming/ConstantName:
1046
+ Description: Constants should use SCREAMING_SNAKE_CASE.
1047
+ Enabled: true
1048
+ Naming/FileName:
1049
+ Description: Use snake_case for source file names.
1050
+ Enabled: true
1051
+ Exclude: []
1052
+ ExpectMatchingDefinition: false
1053
+ CheckDefinitionPathHierarchy: true
1054
+ Regex:
1055
+ IgnoreExecutableScripts: true
1056
+ AllowedAcronyms:
1057
+ - CLI
1058
+ - DSL
1059
+ - ACL
1060
+ - API
1061
+ - ASCII
1062
+ - CPU
1063
+ - CSS
1064
+ - DNS
1065
+ - EOF
1066
+ - GUID
1067
+ - HTML
1068
+ - HTTP
1069
+ - HTTPS
1070
+ - ID
1071
+ - IP
1072
+ - JSON
1073
+ - LHS
1074
+ - QPS
1075
+ - RAM
1076
+ - RHS
1077
+ - RPC
1078
+ - SLA
1079
+ - SMTP
1080
+ - SQL
1081
+ - SSH
1082
+ - TCP
1083
+ - TLS
1084
+ - TTL
1085
+ - UDP
1086
+ - UI
1087
+ - UID
1088
+ - UUID
1089
+ - URI
1090
+ - URL
1091
+ - UTF8
1092
+ - VM
1093
+ - XML
1094
+ - XMPP
1095
+ - XSRF
1096
+ - XSS
1097
+ Naming/HeredocDelimiterCase:
1098
+ Description: Use configured case for heredoc delimiters.
1099
+ Enabled: true
1100
+ EnforcedStyle: uppercase
1101
+ Naming/HeredocDelimiterNaming:
1102
+ Description: Use descriptive heredoc delimiters.
1103
+ Enabled: true
1104
+ ForbiddenDelimiters:
1105
+ - !ruby/regexp /(^|\s)(EO[A-Z]{1}|END)(\s|$)/
1106
+ Naming/MemoizedInstanceVariableName:
1107
+ Description: Memoized method name should match memo instance variable name.
1108
+ Enabled: true
1109
+ EnforcedStyleForLeadingUnderscores: disallowed
1110
+ SupportedStylesForLeadingUnderscores:
1111
+ - disallowed
1112
+ - required
1113
+ - optional
1114
+ Naming/MethodName:
1115
+ Description: Use the configured style when naming methods.
1116
+ Enabled: true
1117
+ EnforcedStyle: snake_case
1118
+ IgnoredPatterns: []
1119
+ Naming/MethodParameterName:
1120
+ Description: Checks for method parameter names that contain capital letters, end
1121
+ in numbers, or do not meet a minimal length.
1122
+ Enabled: true
1123
+ MinNameLength: 3
1124
+ AllowNamesEndingInNumbers: true
1125
+ AllowedNames:
1126
+ - at
1127
+ - by
1128
+ - db
1129
+ - id
1130
+ - in
1131
+ - io
1132
+ - ip
1133
+ - of
1134
+ - 'on'
1135
+ - os
1136
+ - pp
1137
+ - to
1138
+ ForbiddenNames: []
1139
+ Naming/PredicateName:
1140
+ Description: Check the names of predicate methods.
1141
+ Enabled: true
1142
+ NamePrefix:
1143
+ - is_
1144
+ - has_
1145
+ - have_
1146
+ ForbiddenPrefixes:
1147
+ - is_
1148
+ - has_
1149
+ - have_
1150
+ AllowedMethods:
1151
+ - is_a?
1152
+ MethodDefinitionMacros:
1153
+ - define_method
1154
+ - define_singleton_method
1155
+ Exclude:
1156
+ - spec/**/*
1157
+ Naming/RescuedExceptionsVariableName:
1158
+ Description: Use consistent rescued exceptions variables naming.
1159
+ Enabled: true
1160
+ PreferredName: e
1161
+ Naming/VariableName:
1162
+ Description: Use the configured style when naming variables.
1163
+ Enabled: true
1164
+ EnforcedStyle: snake_case
1165
+ Naming/VariableNumber:
1166
+ Description: Use the configured style when numbering variables.
1167
+ Enabled: true
1168
+ EnforcedStyle: normalcase
1169
+ Performance/AncestorsInclude:
1170
+ Description: Use `A <= B` instead of `A.ancestors.include?(B)`.
1171
+ Reference: https://github.com/JuanitoFatas/fast-ruby#ancestorsinclude-vs--code
1172
+ Enabled: true
1173
+ Safe: false
1174
+ Performance/BigDecimalWithNumericArgument:
1175
+ Description: Convert numeric argument to string before passing to BigDecimal.
1176
+ Enabled: true
1177
+ Performance/BindCall:
1178
+ Description: Use `bind_call(obj, args, ...)` instead of `bind(obj).call(args,
1179
+ ...)`.
1180
+ Enabled: true
1181
+ Performance/Caller:
1182
+ Description: Use `caller(n..n)` instead of `caller`.
1183
+ Enabled: true
1184
+ Performance/CaseWhenSplat:
1185
+ Description: Reordering `when` conditions with a splat to the end of the `when`
1186
+ branches can improve performance.
1187
+ Enabled: true
1188
+ AutoCorrect: false
1189
+ SafeAutoCorrect: false
1190
+ Performance/Casecmp:
1191
+ Description: Use `casecmp` rather than `downcase ==`, `upcase ==`, `== downcase`,
1192
+ or `== upcase`..
1193
+ Reference: https://github.com/JuanitoFatas/fast-ruby#stringcasecmp-vs-stringdowncase---code
1194
+ Enabled: true
1195
+ Safe: false
1196
+ Performance/ChainArrayAllocation:
1197
+ Description: Instead of chaining array methods that allocate new arrays, mutate
1198
+ an existing array.
1199
+ Reference: https://twitter.com/schneems/status/1034123879978029057
1200
+ Enabled: false
1201
+ Performance/CompareWithBlock:
1202
+ Description: Use `sort_by(&:foo)` instead of `sort { |a, b| a.foo <=> b.foo }`.
1203
+ Enabled: true
1204
+ Performance/Count:
1205
+ Description: Use `count` instead of `{select,find_all,filter,reject}...{size,count,length}`.
1206
+ SafeAutoCorrect: false
1207
+ Enabled: true
1208
+ Performance/DeletePrefix:
1209
+ Description: Use `delete_prefix` instead of `gsub`.
1210
+ Enabled: true
1211
+ SafeMultiline: true
1212
+ Performance/DeleteSuffix:
1213
+ Description: Use `delete_suffix` instead of `gsub`.
1214
+ Enabled: true
1215
+ SafeMultiline: true
1216
+ Performance/Detect:
1217
+ Description: Use `detect` instead of `select.first`, `find_all.first`, `filter.first`,
1218
+ `select.last`, `find_all.last`, and `filter.last`.
1219
+ Reference: https://github.com/JuanitoFatas/fast-ruby#enumerabledetect-vs-enumerableselectfirst-code
1220
+ SafeAutoCorrect: false
1221
+ Enabled: true
1222
+ Performance/DoubleStartEndWith:
1223
+ Description: Use `str.{start,end}_with?(x, ..., y, ...)` instead of `str.{start,end}_with?(x,
1224
+ ...) || str.{start,end}_with?(y, ...)`.
1225
+ Enabled: true
1226
+ IncludeActiveSupportAliases: false
1227
+ Performance/EndWith:
1228
+ Description: Use `end_with?` instead of a regex match anchored to the end of a
1229
+ string.
1230
+ Reference: https://github.com/JuanitoFatas/fast-ruby#stringmatch-vs-stringstart_withstringend_with-code-start-code-end
1231
+ SafeAutoCorrect: false
1232
+ AutoCorrect: false
1233
+ Enabled: true
1234
+ SafeMultiline: true
1235
+ Performance/FixedSize:
1236
+ Description: Do not compute the size of statically sized objects except in constants.
1237
+ Enabled: true
1238
+ Performance/FlatMap:
1239
+ Description: Use `Enumerable#flat_map` instead of `Enumerable#map...Array#flatten(1)`
1240
+ or `Enumberable#collect..Array#flatten(1)`.
1241
+ Reference: https://github.com/JuanitoFatas/fast-ruby#enumerablemaparrayflatten-vs-enumerableflat_map-code
1242
+ Enabled: true
1243
+ EnabledForFlattenWithoutParams: false
1244
+ Performance/InefficientHashSearch:
1245
+ Description: Use `key?` or `value?` instead of `keys.include?` or `values.include?`.
1246
+ Reference: https://github.com/JuanitoFatas/fast-ruby#hashkey-instead-of-hashkeysinclude-code
1247
+ Enabled: true
1248
+ Safe: false
1249
+ Performance/IoReadlines:
1250
+ Description: Use `IO.each_line` (`IO#each_line`) instead of `IO.readlines` (`IO#readlines`).
1251
+ Reference: https://docs.gitlab.com/ee/development/performance.html#reading-from-files-and-other-data-sources
1252
+ Enabled: false
1253
+ Performance/OpenStruct:
1254
+ Description: Use `Struct` instead of `OpenStruct`.
1255
+ Enabled: false
1256
+ Safe: false
1257
+ Performance/RangeInclude:
1258
+ Description: Use `Range#cover?` instead of `Range#include?` (or `Range#member?`).
1259
+ Reference: https://github.com/JuanitoFatas/fast-ruby#cover-vs-include-code
1260
+ Enabled: true
1261
+ Safe: false
1262
+ Performance/RedundantBlockCall:
1263
+ Description: Use `yield` instead of `block.call`.
1264
+ Reference: https://github.com/JuanitoFatas/fast-ruby#proccall-and-block-arguments-vs-yieldcode
1265
+ Enabled: true
1266
+ Performance/RedundantMatch:
1267
+ Description: Use `=~` instead of `String#match` or `Regexp#match` in a context
1268
+ where the returned `MatchData` is not needed.
1269
+ Enabled: true
1270
+ Performance/RedundantMerge:
1271
+ Description: Use Hash#[]=, rather than Hash#merge! with a single key-value pair.
1272
+ Reference: https://github.com/JuanitoFatas/fast-ruby#hashmerge-vs-hash-code
1273
+ Enabled: true
1274
+ MaxKeyValuePairs: 2
1275
+ Performance/RedundantSortBlock:
1276
+ Description: Use `sort` instead of `sort { |a, b| a <=> b }`.
1277
+ Enabled: true
1278
+ Performance/RedundantStringChars:
1279
+ Description: Checks for redundant `String#chars`.
1280
+ Enabled: true
1281
+ Performance/RegexpMatch:
1282
+ Description: Use `match?` instead of `Regexp#match`, `String#match`, `Symbol#match`,
1283
+ `Regexp#===`, or `=~` when `MatchData` is not used.
1284
+ Reference: https://github.com/JuanitoFatas/fast-ruby#regexp-vs-stringmatch-vs-string-vs-stringmatch-code-
1285
+ Enabled: true
1286
+ Performance/ReverseEach:
1287
+ Description: Use `reverse_each` instead of `reverse.each`.
1288
+ Reference: https://github.com/JuanitoFatas/fast-ruby#enumerablereverseeach-vs-enumerablereverse_each-code
1289
+ Enabled: true
1290
+ Performance/ReverseFirst:
1291
+ Description: Use `last(n).reverse` instead of `reverse.first(n)`.
1292
+ Enabled: true
1293
+ Performance/Size:
1294
+ Description: Use `size` instead of `count` for counting the number of elements
1295
+ in `Array` and `Hash`.
1296
+ Reference: https://github.com/JuanitoFatas/fast-ruby#arraylength-vs-arraysize-vs-arraycount-code
1297
+ Enabled: true
1298
+ Performance/SortReverse:
1299
+ Description: Use `sort.reverse` instead of `sort { |a, b| b <=> a }`.
1300
+ Enabled: true
1301
+ Performance/Squeeze:
1302
+ Description: Use `squeeze('a')` instead of `gsub(/a+/, 'a')`.
1303
+ Reference: https://github.com/JuanitoFatas/fast-ruby#remove-extra-spaces-or-other-contiguous-characters-code
1304
+ Enabled: true
1305
+ Performance/StartWith:
1306
+ Description: Use `start_with?` instead of a regex match anchored to the beginning
1307
+ of a string.
1308
+ Reference: https://github.com/JuanitoFatas/fast-ruby#stringmatch-vs-stringstart_withstringend_with-code-start-code-end
1309
+ SafeAutoCorrect: false
1310
+ AutoCorrect: false
1311
+ Enabled: true
1312
+ SafeMultiline: true
1313
+ Performance/StringInclude:
1314
+ Description: Use `String#include?` instead of a regex match with literal-only
1315
+ pattern.
1316
+ Enabled: true
1317
+ AutoCorrect: false
1318
+ SafeAutoCorrect: false
1319
+ Performance/StringReplacement:
1320
+ Description: Use `tr` instead of `gsub` when you are replacing the same number
1321
+ of characters. Use `delete` instead of `gsub` when you are deleting characters.
1322
+ Reference: https://github.com/JuanitoFatas/fast-ruby#stringgsub-vs-stringtr-code
1323
+ Enabled: true
1324
+ Performance/TimesMap:
1325
+ Description: Checks for .times.map calls.
1326
+ AutoCorrect: false
1327
+ Enabled: true
1328
+ SafeAutoCorrect: false
1329
+ Performance/UnfreezeString:
1330
+ Description: Use unary plus to get an unfrozen string literal.
1331
+ Enabled: true
1332
+ Performance/UriDefaultParser:
1333
+ Description: Use `URI::DEFAULT_PARSER` instead of `URI::Parser.new`.
1334
+ Enabled: true
1335
+ RSpec/AlignLeftLetBrace:
1336
+ Description: Checks that left braces for adjacent single line lets are aligned.
1337
+ Enabled: false
1338
+ RSpec/AlignRightLetBrace:
1339
+ Description: Checks that right braces for adjacent single line lets are aligned.
1340
+ Enabled: false
1341
+ RSpec/AnyInstance:
1342
+ Description: Check that instances are not being stubbed globally.
1343
+ Enabled: true
1344
+ RSpec/AroundBlock:
1345
+ Description: Checks that around blocks actually run the test.
1346
+ Enabled: true
1347
+ RSpec/Be:
1348
+ Description: Check for expectations where `be` is used without argument.
1349
+ Enabled: true
1350
+ RSpec/BeEql:
1351
+ Description: Check for expectations where `be(...)` can replace `eql(...)`.
1352
+ Enabled: true
1353
+ RSpec/BeforeAfterAll:
1354
+ Description: Check that before/after(:all) isn't being used.
1355
+ Enabled: true
1356
+ Exclude:
1357
+ - spec/spec_helper.rb
1358
+ - spec/rails_helper.rb
1359
+ - spec/support/**/*.rb
1360
+ RSpec/ContextMethod:
1361
+ Description: "`context` should not be used for specifying methods."
1362
+ Enabled: true
1363
+ RSpec/ContextWording:
1364
+ Description: Checks that `context` docstring starts with an allowed prefix.
1365
+ Enabled: true
1366
+ Prefixes:
1367
+ - when
1368
+ - with
1369
+ - without
1370
+ RSpec/DescribeClass:
1371
+ Description: Check that the first argument to the top-level describe is a constant.
1372
+ Enabled: true
1373
+ RSpec/DescribeMethod:
1374
+ Description: Checks that the second argument to `describe` specifies a method.
1375
+ Enabled: true
1376
+ RSpec/DescribeSymbol:
1377
+ Description: Avoid describing symbols.
1378
+ Enabled: true
1379
+ RSpec/DescribedClass:
1380
+ Description: Checks that tests use `described_class`.
1381
+ Enabled: true
1382
+ SkipBlocks: false
1383
+ EnforcedStyle: described_class
1384
+ SafeAutoCorrect: false
1385
+ RSpec/DescribedClassModuleWrapping:
1386
+ Description: Avoid opening modules and defining specs within them.
1387
+ Enabled: false
1388
+ RSpec/Dialect:
1389
+ Description: This cop enforces custom RSpec dialects.
1390
+ Enabled: false
1391
+ PreferredMethods: {}
1392
+ RSpec/EmptyExampleGroup:
1393
+ Description: Checks if an example group does not include any tests.
1394
+ Enabled: true
1395
+ CustomIncludeMethods: []
1396
+ RSpec/EmptyHook:
1397
+ Description: Checks for empty before and after hooks.
1398
+ Enabled: true
1399
+ RSpec/EmptyLineAfterExample:
1400
+ Description: Checks if there is an empty line after example blocks.
1401
+ Enabled: true
1402
+ AllowConsecutiveOneLiners: true
1403
+ RSpec/EmptyLineAfterExampleGroup:
1404
+ Description: Checks if there is an empty line after example group blocks.
1405
+ Enabled: true
1406
+ RSpec/EmptyLineAfterFinalLet:
1407
+ Description: Checks if there is an empty line after the last let block.
1408
+ Enabled: true
1409
+ RSpec/EmptyLineAfterHook:
1410
+ Description: Checks if there is an empty line after hook blocks.
1411
+ Enabled: true
1412
+ RSpec/EmptyLineAfterSubject:
1413
+ Description: Checks if there is an empty line after subject block.
1414
+ Enabled: true
1415
+ RSpec/ExampleLength:
1416
+ Description: Checks for long examples.
1417
+ Enabled: true
1418
+ Max: 5
1419
+ Exclude:
1420
+ - spec/requests/**/*
1421
+ - spec/features/**/*
1422
+ - spec/routing/**/*
1423
+ RSpec/ExampleWithoutDescription:
1424
+ Description: Checks for examples without a description.
1425
+ Enabled: true
1426
+ EnforcedStyle: always_allow
1427
+ RSpec/ExampleWording:
1428
+ Description: Checks for common mistakes in example descriptions.
1429
+ Enabled: true
1430
+ CustomTransform:
1431
+ be: is
1432
+ BE: IS
1433
+ have: has
1434
+ HAVE: HAS
1435
+ IgnoredWords: []
1436
+ RSpec/ExpectActual:
1437
+ Description: Checks for `expect(...)` calls containing literal values.
1438
+ Enabled: true
1439
+ Exclude:
1440
+ - spec/routing/**/*
1441
+ RSpec/ExpectChange:
1442
+ Description: Checks for consistent style of change matcher.
1443
+ Enabled: true
1444
+ EnforcedStyle: method_call
1445
+ RSpec/ExpectInHook:
1446
+ Description: Do not use `expect` in hooks such as `before`.
1447
+ Enabled: true
1448
+ RSpec/ExpectOutput:
1449
+ Description: Checks for opportunities to use `expect { ... }.to output`.
1450
+ Enabled: true
1451
+ RSpec/FilePath:
1452
+ Description: Checks that spec file paths are consistent and well-formed.
1453
+ Enabled: true
1454
+ CustomTransform:
1455
+ RuboCop: rubocop
1456
+ RSpec: rspec
1457
+ IgnoreMethods: false
1458
+ SpecSuffixOnly: false
1459
+ RSpec/Focus:
1460
+ Description: Checks if examples are focused.
1461
+ Enabled: true
1462
+ RSpec/HookArgument:
1463
+ Description: Checks the arguments passed to `before`, `around`, and `after`.
1464
+ Enabled: true
1465
+ EnforcedStyle: implicit
1466
+ RSpec/HooksBeforeExamples:
1467
+ Description: Checks for before/around/after hooks that come after an example.
1468
+ Enabled: true
1469
+ RSpec/ImplicitBlockExpectation:
1470
+ Description: Check that implicit block expectation syntax is not used.
1471
+ Enabled: true
1472
+ RSpec/ImplicitExpect:
1473
+ Description: Check that a consistent implicit expectation style is used.
1474
+ Enabled: true
1475
+ EnforcedStyle: is_expected
1476
+ RSpec/ImplicitSubject:
1477
+ Description: Checks for usage of implicit subject (`is_expected` / `should`).
1478
+ Enabled: true
1479
+ EnforcedStyle: single_line_only
1480
+ RSpec/InstanceSpy:
1481
+ Description: Checks for `instance_double` used with `have_received`.
1482
+ Enabled: true
1483
+ RSpec/InstanceVariable:
1484
+ Description: Checks for instance variable usage in specs.
1485
+ Enabled: true
1486
+ AssignmentOnly: false
1487
+ RSpec/InvalidPredicateMatcher:
1488
+ Description: Checks invalid usage for predicate matcher.
1489
+ Enabled: true
1490
+ RSpec/ItBehavesLike:
1491
+ Description: Checks that only one `it_behaves_like` style is used.
1492
+ Enabled: true
1493
+ EnforcedStyle: it_behaves_like
1494
+ RSpec/IteratedExpectation:
1495
+ Description: Check that `all` matcher is used instead of iterating over an array.
1496
+ Enabled: true
1497
+ RSpec/LeadingSubject:
1498
+ Description: Enforce that subject is the first definition in the test.
1499
+ Enabled: true
1500
+ RSpec/LeakyConstantDeclaration:
1501
+ Description: Checks that no class, module, or constant is declared.
1502
+ Enabled: true
1503
+ RSpec/LetBeforeExamples:
1504
+ Description: Checks for `let` definitions that come after an example.
1505
+ Enabled: true
1506
+ RSpec/LetSetup:
1507
+ Description: Checks unreferenced `let!` calls being used for test setup.
1508
+ Enabled: true
1509
+ RSpec/MessageChain:
1510
+ Description: Check that chains of messages are not being stubbed.
1511
+ Enabled: true
1512
+ RSpec/MessageExpectation:
1513
+ Description: Checks for consistent message expectation style.
1514
+ Enabled: false
1515
+ EnforcedStyle: allow
1516
+ RSpec/MessageSpies:
1517
+ Description: Checks that message expectations are set using spies.
1518
+ Enabled: true
1519
+ EnforcedStyle: have_received
1520
+ RSpec/MissingExampleGroupArgument:
1521
+ Description: Checks that the first argument to an example group is not empty.
1522
+ Enabled: true
1523
+ RSpec/MultipleDescribes:
1524
+ Description: Checks for multiple top-level example groups.
1525
+ Enabled: true
1526
+ RSpec/MultipleExpectations:
1527
+ Description: Checks if examples contain too many `expect` calls.
1528
+ Enabled: true
1529
+ Max: 5
1530
+ RSpec/MultipleMemoizedHelpers:
1531
+ Description: Checks if example groups contain too many `let` and `subject` calls.
1532
+ Enabled: true
1533
+ AllowSubject: true
1534
+ Max: 5
1535
+ RSpec/MultipleSubjects:
1536
+ Description: Checks if an example group defines `subject` multiple times.
1537
+ Enabled: true
1538
+ RSpec/NamedSubject:
1539
+ Description: Checks for explicitly referenced test subjects.
1540
+ Enabled: true
1541
+ IgnoreSharedExamples: true
1542
+ RSpec/NestedGroups:
1543
+ Description: Checks for nested example groups.
1544
+ Enabled: true
1545
+ Max: 6
1546
+ RSpec/NotToNot:
1547
+ Description: Checks for consistent method usage for negating expectations.
1548
+ Enabled: true
1549
+ EnforcedStyle: not_to
1550
+ RSpec/OverwritingSetup:
1551
+ Description: Checks if there is a let/subject that overwrites an existing one.
1552
+ Enabled: true
1553
+ RSpec/Pending:
1554
+ Description: Checks for any pending or skipped examples.
1555
+ Enabled: true
1556
+ RSpec/PredicateMatcher:
1557
+ Description: Prefer using predicate matcher over using predicate method directly.
1558
+ Enabled: true
1559
+ Strict: true
1560
+ EnforcedStyle: inflected
1561
+ AllowedExplicitMatchers: []
1562
+ SafeAutoCorrect: false
1563
+ RSpec/ReceiveCounts:
1564
+ Description: Check for `once` and `twice` receive counts matchers usage.
1565
+ Enabled: true
1566
+ RSpec/ReceiveNever:
1567
+ Description: Prefer `not_to receive(...)` over `receive(...).never`.
1568
+ Enabled: true
1569
+ RSpec/RepeatedDescription:
1570
+ Description: Check for repeated description strings in example groups.
1571
+ Enabled: true
1572
+ RSpec/RepeatedExample:
1573
+ Description: Check for repeated examples within example groups.
1574
+ Enabled: true
1575
+ RSpec/RepeatedExampleGroupBody:
1576
+ Description: Check for repeated describe and context block body.
1577
+ Enabled: true
1578
+ RSpec/RepeatedExampleGroupDescription:
1579
+ Description: Check for repeated example group descriptions.
1580
+ Enabled: true
1581
+ RSpec/ReturnFromStub:
1582
+ Description: Checks for consistent style of stub's return setting.
1583
+ Enabled: true
1584
+ EnforcedStyle: and_return
1585
+ RSpec/ScatteredLet:
1586
+ Description: Checks for let scattered across the example group.
1587
+ Enabled: true
1588
+ RSpec/ScatteredSetup:
1589
+ Description: Checks for setup scattered across multiple hooks in an example group.
1590
+ Enabled: true
1591
+ RSpec/SharedContext:
1592
+ Description: Checks for proper shared_context and shared_examples usage.
1593
+ Enabled: true
1594
+ RSpec/SharedExamples:
1595
+ Description: Enforces use of string to titleize shared examples.
1596
+ Enabled: true
1597
+ RSpec/SingleArgumentMessageChain:
1598
+ Description: Checks that chains of messages contain more than one element.
1599
+ Enabled: true
1600
+ RSpec/SubjectStub:
1601
+ Description: Checks for stubbed test subjects.
1602
+ Enabled: true
1603
+ RSpec/UnspecifiedException:
1604
+ Description: Checks for a specified error in checking raised errors.
1605
+ Enabled: true
1606
+ RSpec/VariableDefinition:
1607
+ Description: Checks that memoized helpers names are symbols or strings.
1608
+ Enabled: true
1609
+ EnforcedStyle: symbols
1610
+ RSpec/VariableName:
1611
+ Description: Checks that memoized helper names use the configured style.
1612
+ Enabled: true
1613
+ EnforcedStyle: snake_case
1614
+ IgnoredPatterns: []
1615
+ RSpec/VerifiedDoubles:
1616
+ Description: Prefer using verifying doubles over normal doubles.
1617
+ Enabled: true
1618
+ IgnoreNameless: true
1619
+ IgnoreSymbolicNames: false
1620
+ RSpec/VoidExpect:
1621
+ Description: This cop checks void `expect()`.
1622
+ Enabled: true
1623
+ RSpec/Yield:
1624
+ Description: This cop checks for calling a block within a stub.
1625
+ Enabled: true
1626
+ Rails/ActionFilter:
1627
+ Description: Enforces consistent use of action filter methods.
1628
+ Enabled: true
1629
+ EnforcedStyle: action
1630
+ Include:
1631
+ - app/controllers/**/*.rb
1632
+ Rails/ActiveRecordAliases:
1633
+ Description: 'Avoid Active Record aliases: Use `update` instead of `update_attributes`.
1634
+ Use `update!` instead of `update_attributes!`.'
1635
+ Enabled: true
1636
+ Rails/ActiveRecordCallbacksOrder:
1637
+ Description: Order callback declarations in the order in which they will be executed.
1638
+ Enabled: true
1639
+ Include:
1640
+ - app/models/**/*.rb
1641
+ Rails/ActiveRecordOverride:
1642
+ Description: Check for overriding Active Record methods instead of using callbacks.
1643
+ Enabled: true
1644
+ Include:
1645
+ - app/models/**/*.rb
1646
+ Rails/ActiveSupportAliases:
1647
+ Description: 'Avoid ActiveSupport aliases of standard ruby methods: `String#starts_with?`,
1648
+ `String#ends_with?`, `Array#append`, `Array#prepend`.'
1649
+ Enabled: true
1650
+ Rails/ApplicationController:
1651
+ Description: Check that controllers subclass ApplicationController.
1652
+ Enabled: true
1653
+ Rails/ApplicationJob:
1654
+ Description: Check that jobs subclass ApplicationJob.
1655
+ Enabled: true
1656
+ Rails/ApplicationMailer:
1657
+ Description: Check that mailers subclass ApplicationMailer.
1658
+ Enabled: true
1659
+ Rails/ApplicationRecord:
1660
+ Description: Check that models subclass ApplicationRecord.
1661
+ Enabled: true
1662
+ Rails/AssertNot:
1663
+ Description: Use `assert_not` instead of `assert !`.
1664
+ Enabled: true
1665
+ Include:
1666
+ - "**/test/**/*"
1667
+ Rails/BelongsTo:
1668
+ Description: 'Use `optional: true` instead of `required: false` for `belongs_to`
1669
+ relations.'
1670
+ Enabled: true
1671
+ Rails/Blank:
1672
+ Description: Enforces use of `blank?`.
1673
+ Enabled: true
1674
+ NilOrEmpty: true
1675
+ NotPresent: true
1676
+ UnlessPresent: true
1677
+ Rails/BulkChangeTable:
1678
+ Description: Check whether alter queries are combinable.
1679
+ Enabled: true
1680
+ Database:
1681
+ SupportedDatabases:
1682
+ - mysql
1683
+ - postgresql
1684
+ Include:
1685
+ - db/migrate/*.rb
1686
+ Rails/ContentTag:
1687
+ Description: Use `tag` instead of `content_tag`.
1688
+ Reference:
1689
+ - https://github.com/rails/rails/issues/25195
1690
+ - https://api.rubyonrails.org/classes/ActionView/Helpers/TagHelper.html#method-i-content_tag
1691
+ Enabled: true
1692
+ Rails/CreateTableWithTimestamps:
1693
+ Description: Checks the migration for which timestamps are not included when creating
1694
+ a new table.
1695
+ Enabled: true
1696
+ Include:
1697
+ - db/migrate/*.rb
1698
+ Rails/Date:
1699
+ Description: Checks the correct usage of date aware methods, such as Date.today,
1700
+ Date.current etc.
1701
+ Enabled: true
1702
+ EnforcedStyle: flexible
1703
+ Rails/DefaultScope:
1704
+ Description: Avoid use of `default_scope`.
1705
+ Enabled: true
1706
+ Rails/Delegate:
1707
+ Description: Prefer delegate method for delegations.
1708
+ Enabled: true
1709
+ EnforceForPrefixed: true
1710
+ Rails/DelegateAllowBlank:
1711
+ Description: Do not use allow_blank as an option to delegate.
1712
+ Enabled: true
1713
+ Rails/DynamicFindBy:
1714
+ Description: Use `find_by` instead of dynamic `find_by_*`.
1715
+ Enabled: true
1716
+ Whitelist:
1717
+ - find_by_sql
1718
+ AllowedMethods:
1719
+ - find_by_sql
1720
+ AllowedReceivers:
1721
+ - Gem::Specification
1722
+ Rails/EnumHash:
1723
+ Description: Prefer hash syntax over array syntax when defining enums.
1724
+ Enabled: true
1725
+ Include:
1726
+ - app/models/**/*.rb
1727
+ Rails/EnumUniqueness:
1728
+ Description: Avoid duplicate integers in hash-syntax `enum` declaration.
1729
+ Enabled: true
1730
+ Include:
1731
+ - app/models/**/*.rb
1732
+ Rails/EnvironmentComparison:
1733
+ Description: Favor `Rails.env.production?` over `Rails.env == 'production'`.
1734
+ Enabled: true
1735
+ Rails/Exit:
1736
+ Description: Favor `fail`, `break`, `return`, etc. over `exit` in application
1737
+ or library code outside of Rake files to avoid exits during unit testing or
1738
+ running in production.
1739
+ Enabled: true
1740
+ Include:
1741
+ - app/**/*.rb
1742
+ - config/**/*.rb
1743
+ - lib/**/*.rb
1744
+ Exclude:
1745
+ - lib/**/*.rake
1746
+ Rails/FilePath:
1747
+ Description: Use `Rails.root.join` for file path joining.
1748
+ Enabled: true
1749
+ EnforcedStyle: slashes
1750
+ Rails/FindBy:
1751
+ Description: Prefer find_by over where.first.
1752
+ Enabled: true
1753
+ Include:
1754
+ - app/models/**/*.rb
1755
+ Rails/FindById:
1756
+ Description: Favor the use of `find` over `where.take!`, `find_by!`, and `find_by_id!`
1757
+ when you need to retrieve a single record by primary key when you expect it
1758
+ to be found.
1759
+ Enabled: true
1760
+ Rails/FindEach:
1761
+ Description: Prefer all.find_each over all.find.
1762
+ Enabled: true
1763
+ Include:
1764
+ - app/models/**/*.rb
1765
+ Rails/HasAndBelongsToMany:
1766
+ Description: Prefer has_many :through to has_and_belongs_to_many.
1767
+ Enabled: true
1768
+ Include:
1769
+ - app/models/**/*.rb
1770
+ Rails/HasManyOrHasOneDependent:
1771
+ Description: Define the dependent option to the has_many and has_one associations.
1772
+ Enabled: true
1773
+ Include:
1774
+ - app/models/**/*.rb
1775
+ Rails/HelperInstanceVariable:
1776
+ Description: Do not use instance variables in helpers.
1777
+ Enabled: true
1778
+ Include:
1779
+ - app/helpers/**/*.rb
1780
+ Rails/HttpPositionalArguments:
1781
+ Description: Use keyword arguments instead of positional arguments in http method
1782
+ calls.
1783
+ Enabled: true
1784
+ Include:
1785
+ - spec/**/*
1786
+ - test/**/*
1787
+ Rails/HttpStatus:
1788
+ Description: Enforces use of symbolic or numeric value to describe HTTP status.
1789
+ Enabled: true
1790
+ EnforcedStyle: symbolic
1791
+ Rails/IgnoredSkipActionFilterOption:
1792
+ Description: Checks that `if` and `only` (or `except`) are not used together as
1793
+ options of `skip_*` action filter.
1794
+ Reference: https://api.rubyonrails.org/classes/AbstractController/Callbacks/ClassMethods.html#method-i-_normalize_callback_options
1795
+ Enabled: true
1796
+ Include:
1797
+ - app/controllers/**/*.rb
1798
+ Rails/IndexBy:
1799
+ Description: Prefer `index_by` over `each_with_object`, `to_h`, or `map`.
1800
+ Enabled: true
1801
+ Rails/IndexWith:
1802
+ Description: Prefer `index_with` over `each_with_object`, `to_h`, or `map`.
1803
+ Enabled: true
1804
+ Rails/Inquiry:
1805
+ Description: Prefer Ruby's comparison operators over Active Support's `Array#inquiry`
1806
+ and `String#inquiry`.
1807
+ Enabled: true
1808
+ Rails/InverseOf:
1809
+ Description: Checks for associations where the inverse cannot be determined automatically.
1810
+ Enabled: true
1811
+ Include:
1812
+ - app/models/**/*.rb
1813
+ Rails/LexicallyScopedActionFilter:
1814
+ Description: Checks that methods specified in the filter's `only` or `except`
1815
+ options are explicitly defined in the controller.
1816
+ Enabled: true
1817
+ Safe: false
1818
+ Include:
1819
+ - app/controllers/**/*.rb
1820
+ Rails/LinkToBlank:
1821
+ Description: 'Checks that `link_to` with a `target: "_blank"` have a `rel: "noopener"`
1822
+ option passed to them.'
1823
+ Reference:
1824
+ - https://mathiasbynens.github.io/rel-noopener/
1825
+ - https://html.spec.whatwg.org/multipage/links.html#link-type-noopener
1826
+ - https://html.spec.whatwg.org/multipage/links.html#link-type-noreferrer
1827
+ Enabled: true
1828
+ Rails/MailerName:
1829
+ Description: Mailer should end with `Mailer` suffix.
1830
+ Enabled: true
1831
+ Include:
1832
+ - app/mailers/**/*.rb
1833
+ Rails/MatchRoute:
1834
+ Description: Don't use `match` to define any routes unless there is a need to
1835
+ map multiple request types among [:get, :post, :patch, :put, :delete] to a
1836
+ single action using the `:via` option.
1837
+ Enabled: true
1838
+ Include:
1839
+ - config/routes.rb
1840
+ - config/routes/**/*.rb
1841
+ Rails/NegateInclude:
1842
+ Description: Prefer `collection.exclude?(obj)` over `!collection.include?(obj)`.
1843
+ Enabled: true
1844
+ Rails/NotNullColumn:
1845
+ Description: Do not add a NOT NULL column without a default value.
1846
+ Enabled: true
1847
+ Include:
1848
+ - db/migrate/*.rb
1849
+ Rails/Output:
1850
+ Description: Checks for calls to puts, print, etc.
1851
+ Enabled: true
1852
+ Include:
1853
+ - app/**/*.rb
1854
+ - config/**/*.rb
1855
+ - db/**/*.rb
1856
+ - lib/**/*.rb
1857
+ Rails/OutputSafety:
1858
+ Description: The use of `html_safe` or `raw` may be a security risk.
1859
+ Enabled: true
1860
+ Rails/Pick:
1861
+ Description: Prefer `pick` over `pluck(...).first`.
1862
+ Enabled: true
1863
+ Safe: false
1864
+ Rails/Pluck:
1865
+ Description: Prefer `pluck` over `map { ... }`.
1866
+ Enabled: true
1867
+ Rails/PluckId:
1868
+ Description: Use `ids` instead of `pluck(:id)` or `pluck(primary_key)`.
1869
+ Enabled: true
1870
+ Safe: false
1871
+ Rails/PluckInWhere:
1872
+ Description: Use `select` instead of `pluck` in `where` query methods.
1873
+ Enabled: true
1874
+ Safe: false
1875
+ Rails/PluralizationGrammar:
1876
+ Description: Checks for incorrect grammar when using methods like `3.day.ago`.
1877
+ Enabled: true
1878
+ Rails/Presence:
1879
+ Description: Checks code that can be written more easily using `Object#presence`
1880
+ defined by Active Support.
1881
+ Enabled: true
1882
+ Rails/Present:
1883
+ Description: Enforces use of `present?`.
1884
+ Enabled: true
1885
+ NotNilAndNotEmpty: true
1886
+ NotBlank: true
1887
+ UnlessBlank: true
1888
+ Rails/RakeEnvironment:
1889
+ Description: Include `:environment` as a dependency for all Rake tasks.
1890
+ Enabled: true
1891
+ Safe: false
1892
+ Include:
1893
+ - "**/Rakefile"
1894
+ - "**/*.rake"
1895
+ Exclude:
1896
+ - lib/capistrano/tasks/**/*.rake
1897
+ Rails/ReadWriteAttribute:
1898
+ Description: Checks for read_attribute(:attr) and write_attribute(:attr, val).
1899
+ Enabled: true
1900
+ Include:
1901
+ - app/models/**/*.rb
1902
+ Rails/RedundantAllowNil:
1903
+ Description: Finds redundant use of `allow_nil` when `allow_blank` is set to certain
1904
+ values in model validations.
1905
+ Enabled: true
1906
+ Include:
1907
+ - app/models/**/*.rb
1908
+ Rails/RedundantForeignKey:
1909
+ Description: Checks for associations where the `:foreign_key` option is redundant.
1910
+ Enabled: true
1911
+ Rails/RedundantReceiverInWithOptions:
1912
+ Description: Checks for redundant receiver in `with_options`.
1913
+ Enabled: true
1914
+ Rails/ReflectionClassName:
1915
+ Description: Use a string for `class_name` option value in the definition of a
1916
+ reflection.
1917
+ Enabled: true
1918
+ Rails/RefuteMethods:
1919
+ Description: Use `assert_not` methods instead of `refute` methods.
1920
+ Enabled: true
1921
+ EnforcedStyle: assert_not
1922
+ Include:
1923
+ - "**/test/**/*"
1924
+ Rails/RelativeDateConstant:
1925
+ Description: Do not assign relative date to constants.
1926
+ Enabled: true
1927
+ AutoCorrect: false
1928
+ Rails/RenderInline:
1929
+ Description: Prefer using a template over inline rendering.
1930
+ Enabled: true
1931
+ Rails/RenderPlainText:
1932
+ Description: Prefer `render plain:` over `render text:`.
1933
+ Enabled: true
1934
+ ContentTypeCompatibility: true
1935
+ Rails/RequestReferer:
1936
+ Description: Use consistent syntax for request.referer.
1937
+ Enabled: true
1938
+ EnforcedStyle: referer
1939
+ Rails/ReversibleMigration:
1940
+ Description: Checks whether the change method of the migration file is reversible.
1941
+ Reference: https://api.rubyonrails.org/classes/ActiveRecord/Migration/CommandRecorder.html
1942
+ Enabled: true
1943
+ Include:
1944
+ - db/migrate/*.rb
1945
+ Rails/SafeNavigation:
1946
+ Description: Use Ruby's safe navigation operator (`&.`) instead of `try!`.
1947
+ Enabled: true
1948
+ ConvertTry: false
1949
+ Rails/SafeNavigationWithBlank:
1950
+ Description: Avoid `foo&.blank?` in conditionals.
1951
+ Enabled: true
1952
+ Rails/SaveBang:
1953
+ Description: Identifies possible cases where Active Record save! or related should
1954
+ be used.
1955
+ Enabled: false
1956
+ AllowImplicitReturn: true
1957
+ AllowedReceivers: []
1958
+ Rails/ScopeArgs:
1959
+ Description: Checks the arguments of ActiveRecord scopes.
1960
+ Enabled: true
1961
+ Include:
1962
+ - app/models/**/*.rb
1963
+ Rails/ShortI18n:
1964
+ Description: 'Use the short form of the I18n methods: `t` instead of `translate`
1965
+ and `l` instead of `localize`.'
1966
+ Enabled: true
1967
+ EnforcedStyle: conservative
1968
+ Rails/SkipsModelValidations:
1969
+ Description: Use methods that skips model validations with caution. See reference
1970
+ for more information.
1971
+ Reference: https://guides.rubyonrails.org/active_record_validations.html#skipping-validations
1972
+ Enabled: true
1973
+ ForbiddenMethods:
1974
+ - decrement!
1975
+ - decrement_counter
1976
+ - increment!
1977
+ - increment_counter
1978
+ - insert
1979
+ - insert!
1980
+ - insert_all
1981
+ - insert_all!
1982
+ - toggle!
1983
+ - touch
1984
+ - touch_all
1985
+ - update_all
1986
+ - update_attribute
1987
+ - update_column
1988
+ - update_columns
1989
+ - update_counters
1990
+ - upsert
1991
+ - upsert_all
1992
+ AllowedMethods: []
1993
+ Exclude:
1994
+ - "**/*_spec.rb"
1995
+ Rails/TimeZone:
1996
+ Description: Checks the correct usage of time zone aware methods.
1997
+ Reference: http://danilenko.org/2012/7/6/rails_timezones
1998
+ Enabled: true
1999
+ Safe: false
2000
+ EnforcedStyle: flexible
2001
+ Rails/UniqBeforePluck:
2002
+ Description: Prefer the use of uniq or distinct before pluck.
2003
+ Enabled: true
2004
+ EnforcedStyle: conservative
2005
+ AutoCorrect: false
2006
+ Rails/UniqueValidationWithoutIndex:
2007
+ Description: Uniqueness validation should be with a unique index.
2008
+ Enabled: true
2009
+ Include:
2010
+ - app/models/**/*.rb
2011
+ Rails/UnknownEnv:
2012
+ Description: Use correct environment name.
2013
+ Enabled: true
2014
+ Environments:
2015
+ - development
2016
+ - test
2017
+ - production
2018
+ Rails/Validation:
2019
+ Description: Use validates :attribute, hash of validations.
2020
+ Enabled: true
2021
+ Include:
2022
+ - app/models/**/*.rb
2023
+ Rails/WhereExists:
2024
+ Description: Prefer `exists?(...)` over `where(...).exists?`.
2025
+ Enabled: true
2026
+ Rake:
2027
+ Enabled: true
2028
+ Include:
2029
+ - Rakefile
2030
+ - "**/*.rake"
2031
+ Rake/ClassDefinitionInTask:
2032
+ Description: Do not define a class or module in rake task, because it will be
2033
+ defined to the top level.
2034
+ Enabled: true
2035
+ Rake/Desc:
2036
+ Description: Describe the task with `desc` method.
2037
+ Enabled: true
2038
+ Rake/DuplicateNamespace:
2039
+ Description: Do not define namespace with the same name
2040
+ Enabled: true
2041
+ Rake/DuplicateTask:
2042
+ Description: Do not define tasks with the same name
2043
+ Enabled: true
2044
+ Rake/MethodDefinitionInTask:
2045
+ Description: Do not define a method in rake task, because it will be defined to
2046
+ the top level.
2047
+ Enabled: true
2048
+ Security/Eval:
2049
+ Description: The use of eval represents a serious security risk.
2050
+ Enabled: true
2051
+ Security/JSONLoad:
2052
+ Description: Prefer usage of `JSON.parse` over `JSON.load` due to potential security
2053
+ issues. See reference for more information.
2054
+ Reference: https://ruby-doc.org/stdlib-2.7.0/libdoc/json/rdoc/JSON.html#method-i-load
2055
+ Enabled: true
2056
+ AutoCorrect: false
2057
+ SafeAutoCorrect: false
2058
+ Security/MarshalLoad:
2059
+ Description: Avoid using of `Marshal.load` or `Marshal.restore` due to potential
2060
+ security issues. See reference for more information.
2061
+ Reference: https://ruby-doc.org/core-2.7.0/Marshal.html#module-Marshal-label-Security+considerations
2062
+ Enabled: true
2063
+ Security/Open:
2064
+ Description: The use of Kernel#open represents a serious security risk.
2065
+ Enabled: true
2066
+ Safe: false
2067
+ Security/YAMLLoad:
2068
+ Description: Prefer usage of `YAML.safe_load` over `YAML.load` due to potential
2069
+ security issues. See reference for more information.
2070
+ Reference: https://ruby-doc.org/stdlib-2.7.0/libdoc/yaml/rdoc/YAML.html#module-YAML-label-Security
2071
+ Enabled: true
2072
+ SafeAutoCorrect: false
2073
+ Style/AccessModifierDeclarations:
2074
+ Description: Checks style of how access modifiers are used.
2075
+ Enabled: true
2076
+ EnforcedStyle: group
2077
+ AllowModifiersOnSymbols: true
2078
+ Style/AccessorGrouping:
2079
+ Description: Checks for grouping of accessors in `class` and `module` bodies.
2080
+ Enabled: true
2081
+ EnforcedStyle: grouped
2082
+ Style/Alias:
2083
+ Description: Use alias instead of alias_method.
2084
+ Enabled: true
2085
+ EnforcedStyle: prefer_alias
2086
+ Style/AndOr:
2087
+ EnforcedStyle: conditionals
2088
+ Include:
2089
+ - app/controllers/**/*_controller.rb
2090
+ Style/ArrayCoercion:
2091
+ Description: Use Array() instead of explicit Array check or [*var], when dealing
2092
+ with a variable you want to treat as an Array, but you're not certain it's
2093
+ an array.
2094
+ Safe: false
2095
+ Enabled: true
2096
+ Style/ArrayJoin:
2097
+ Description: Use Array#join instead of Array#*.
2098
+ Enabled: true
2099
+ Style/AsciiComments:
2100
+ Description: Use only ascii symbols in comments.
2101
+ Enabled: true
2102
+ AllowedChars: []
2103
+ Style/Attr:
2104
+ Description: Checks for uses of Module#attr.
2105
+ Enabled: true
2106
+ Style/AutoResourceCleanup:
2107
+ Description: Suggests the usage of an auto resource cleanup version of a method
2108
+ (if available).
2109
+ Enabled: true
2110
+ Style/BarePercentLiterals:
2111
+ Description: Checks if usage of %() or %Q() matches configuration.
2112
+ Enabled: true
2113
+ EnforcedStyle: bare_percent
2114
+ Style/BeginBlock:
2115
+ Description: Avoid the use of BEGIN blocks.
2116
+ Enabled: true
2117
+ Style/BisectedAttrAccessor:
2118
+ Description: Checks for places where `attr_reader` and `attr_writer` for the same
2119
+ method can be combined into single `attr_accessor`.
2120
+ Enabled: true
2121
+ Style/BlockComments:
2122
+ Description: Do not use block comments.
2123
+ Enabled: true
2124
+ Style/BlockDelimiters:
2125
+ Description: Avoid using {...} for multi-line blocks (multiline chaining is always
2126
+ ugly). Prefer {...} over do...end for single-line blocks.
2127
+ Enabled: true
2128
+ EnforcedStyle: line_count_based
2129
+ ProceduralMethods:
2130
+ - benchmark
2131
+ - bm
2132
+ - bmbm
2133
+ - create
2134
+ - each_with_object
2135
+ - measure
2136
+ - new
2137
+ - realtime
2138
+ - tap
2139
+ - with_object
2140
+ FunctionalMethods:
2141
+ - let
2142
+ - let!
2143
+ - subject
2144
+ - watch
2145
+ IgnoredMethods:
2146
+ - lambda
2147
+ - proc
2148
+ - it
2149
+ AllowBracesOnProceduralOneLiners: false
2150
+ BracesRequiredMethods: []
2151
+ Style/CaseEquality:
2152
+ Description: Avoid explicit use of the case equality operator(===).
2153
+ Enabled: true
2154
+ AllowOnConstant: false
2155
+ Style/CaseLikeIf:
2156
+ Description: This cop identifies places where `if-elsif` constructions can be
2157
+ replaced with `case-when`.
2158
+ Enabled: true
2159
+ Safe: false
2160
+ Style/CharacterLiteral:
2161
+ Description: Checks for uses of character literals.
2162
+ Enabled: true
2163
+ Style/ClassAndModuleChildren:
2164
+ Description: Checks style of children classes and modules.
2165
+ SafeAutoCorrect: false
2166
+ Enabled: true
2167
+ EnforcedStyle: nested
2168
+ Style/ClassCheck:
2169
+ Description: Enforces consistent use of `Object#is_a?` or `Object#kind_of?`.
2170
+ Enabled: true
2171
+ EnforcedStyle: is_a?
2172
+ Style/ClassMethods:
2173
+ Description: Use self when defining module/class methods.
2174
+ Enabled: true
2175
+ Style/ClassMethodsDefinitions:
2176
+ Description: Enforces using `def self.method_name` or `class << self` to define
2177
+ class methods.
2178
+ Enabled: true
2179
+ EnforcedStyle: def_self
2180
+ Style/ClassVars:
2181
+ Description: Avoid the use of class variables.
2182
+ Enabled: true
2183
+ Style/CollectionMethods:
2184
+ Description: Preferred collection methods.
2185
+ Enabled: true
2186
+ Safe: false
2187
+ PreferredMethods:
2188
+ collect: map
2189
+ collect!: map!
2190
+ inject: reduce
2191
+ detect: find
2192
+ find_all: select
2193
+ Style/ColonMethodCall:
2194
+ Description: 'Do not use :: for method call.'
2195
+ Enabled: true
2196
+ Style/ColonMethodDefinition:
2197
+ Description: 'Do not use :: for defining class methods.'
2198
+ Enabled: true
2199
+ Style/CombinableLoops:
2200
+ Description: Checks for places where multiple consecutive loops over the same
2201
+ data can be combined into a single loop.
2202
+ Enabled: true
2203
+ Safe: false
2204
+ Style/CommandLiteral:
2205
+ Description: Use `` or %x around command literals.
2206
+ Enabled: true
2207
+ EnforcedStyle: backticks
2208
+ AllowInnerBackticks: false
2209
+ Style/CommentAnnotation:
2210
+ Description: Checks formatting of special comments (TODO, FIXME, OPTIMIZE, HACK,
2211
+ REVIEW).
2212
+ Enabled: true
2213
+ Keywords:
2214
+ - TODO
2215
+ - FIXME
2216
+ - OPTIMIZE
2217
+ - HACK
2218
+ - REVIEW
2219
+ Style/CommentedKeyword:
2220
+ Description: Do not place comments on the same line as certain keywords.
2221
+ Enabled: true
2222
+ Style/ConditionalAssignment:
2223
+ Description: Use the return value of `if` and `case` statements for assignment
2224
+ to a variable and variable comparison instead of assigning that variable inside
2225
+ of each branch.
2226
+ Enabled: true
2227
+ EnforcedStyle: assign_to_condition
2228
+ SingleLineConditionsOnly: true
2229
+ IncludeTernaryExpressions: true
2230
+ Style/ConstantVisibility:
2231
+ Description: Check that class- and module constants have visibility declarations.
2232
+ Enabled: true
2233
+ Style/Copyright:
2234
+ Description: Include a copyright notice in each file before any code.
2235
+ Enabled: false
2236
+ Notice: "^Copyright (\\(c\\) )?2[0-9]{3} .+"
2237
+ AutocorrectNotice: ''
2238
+ Style/DateTime:
2239
+ Description: Use Time over DateTime.
2240
+ Enabled: true
2241
+ AllowCoercion: false
2242
+ Style/DefWithParentheses:
2243
+ Description: Use def with parentheses when there are arguments.
2244
+ Enabled: true
2245
+ Style/Dir:
2246
+ Description: Use the `__dir__` method to retrieve the canonicalized absolute path
2247
+ to the current file.
2248
+ Enabled: true
2249
+ Style/DisableCopsWithinSourceCodeDirective:
2250
+ Description: Forbids disabling/enabling cops within source code.
2251
+ Enabled: false
2252
+ Style/Documentation:
2253
+ Description: Document classes and non-namespace modules.
2254
+ Enabled: false
2255
+ Exclude:
2256
+ - spec/**/*
2257
+ - test/**/*
2258
+ Style/DocumentationMethod:
2259
+ Description: Checks for missing documentation comment for public methods.
2260
+ Enabled: false
2261
+ Exclude:
2262
+ - spec/**/*
2263
+ - test/**/*
2264
+ RequireForNonPublicMethods: false
2265
+ Style/DoubleCopDisableDirective:
2266
+ Description: Checks for double rubocop:disable comments on a single line.
2267
+ Enabled: true
2268
+ Style/DoubleNegation:
2269
+ Description: Checks for uses of double negation (!!).
2270
+ Enabled: true
2271
+ EnforcedStyle: allowed_in_returns
2272
+ SafeAutoCorrect: false
2273
+ Style/EachForSimpleLoop:
2274
+ Description: Use `Integer#times` for a simple loop which iterates a fixed number
2275
+ of times.
2276
+ Enabled: true
2277
+ Style/EachWithObject:
2278
+ Description: Prefer `each_with_object` over `inject` or `reduce`.
2279
+ Enabled: true
2280
+ Style/EmptyBlockParameter:
2281
+ Description: Omit pipes for empty block parameters.
2282
+ Enabled: true
2283
+ Style/EmptyCaseCondition:
2284
+ Description: Avoid empty condition in case statements.
2285
+ Enabled: true
2286
+ Style/EmptyElse:
2287
+ Description: Avoid empty else-clauses.
2288
+ Enabled: true
2289
+ EnforcedStyle: both
2290
+ Style/EmptyLambdaParameter:
2291
+ Description: Omit parens for empty lambda parameters.
2292
+ Enabled: true
2293
+ Style/EmptyLiteral:
2294
+ Description: Prefer literals to Array.new/Hash.new/String.new.
2295
+ Enabled: true
2296
+ Style/EmptyMethod:
2297
+ Description: Checks the formatting of empty method definitions.
2298
+ Enabled: true
2299
+ EnforcedStyle: compact
2300
+ Style/Encoding:
2301
+ Description: Use UTF-8 as the source file encoding.
2302
+ Enabled: true
2303
+ Style/EndBlock:
2304
+ Description: Avoid the use of END blocks.
2305
+ Enabled: true
2306
+ Style/EvalWithLocation:
2307
+ Description: Pass `__FILE__` and `__LINE__` to `eval` method, as they are used
2308
+ by backtraces.
2309
+ Enabled: true
2310
+ Style/EvenOdd:
2311
+ Description: Favor the use of `Integer#even?` && `Integer#odd?`.
2312
+ Enabled: true
2313
+ Style/ExpandPathArguments:
2314
+ Description: Use `expand_path(__dir__)` instead of `expand_path('..', __FILE__)`.
2315
+ Enabled: true
2316
+ Style/ExplicitBlockArgument:
2317
+ Description: Consider using explicit block argument to avoid writing block literal
2318
+ that just passes its arguments to another block.
2319
+ Enabled: true
2320
+ Safe: false
2321
+ Style/ExponentialNotation:
2322
+ Description: When using exponential notation, favor a mantissa between 1 (inclusive)
2323
+ and 10 (exclusive).
2324
+ Enabled: true
2325
+ EnforcedStyle: scientific
2326
+ Style/FloatDivision:
2327
+ Description: For performing float division, coerce one side only.
2328
+ Reference: https://github.com/rubocop-hq/ruby-style-guide/issues/628
2329
+ Enabled: true
2330
+ EnforcedStyle: single_coerce
2331
+ Style/For:
2332
+ Description: Checks use of for or each in multiline loops.
2333
+ Enabled: true
2334
+ EnforcedStyle: each
2335
+ Style/FormatString:
2336
+ Description: Enforce the use of Kernel#sprintf, Kernel#format or String#%.
2337
+ Enabled: true
2338
+ EnforcedStyle: format
2339
+ Style/FormatStringToken:
2340
+ Description: Use a consistent style for format string tokens.
2341
+ Enabled: true
2342
+ EnforcedStyle: annotated
2343
+ Style/FrozenStringLiteralComment:
2344
+ Description: Add the frozen_string_literal comment to the top of files to help
2345
+ transition to frozen string literals by default.
2346
+ Enabled: true
2347
+ EnforcedStyle: always
2348
+ SafeAutoCorrect: true
2349
+ Style/GlobalStdStream:
2350
+ Description: Enforces the use of `$stdout/$stderr/$stdin` instead of `STDOUT/STDERR/STDIN`.
2351
+ Enabled: true
2352
+ Style/GlobalVars:
2353
+ Description: Do not introduce global variables.
2354
+ Reference: https://www.zenspider.com/ruby/quickref.html
2355
+ Enabled: true
2356
+ AllowedVariables: []
2357
+ Style/GuardClause:
2358
+ Description: Check for conditionals that can be replaced with guard clauses.
2359
+ Enabled: true
2360
+ MinBodyLength: 1
2361
+ Style/HashAsLastArrayItem:
2362
+ Description: Checks for presence or absence of braces around hash literal as a
2363
+ last array item depending on configuration.
2364
+ Enabled: true
2365
+ EnforcedStyle: braces
2366
+ Style/HashEachMethods:
2367
+ Description: Use Hash#each_key and Hash#each_value.
2368
+ Enabled: true
2369
+ Safe: false
2370
+ Style/HashLikeCase:
2371
+ Description: Checks for places where `case-when` represents a simple 1:1 mapping
2372
+ and can be replaced with a hash lookup.
2373
+ Enabled: true
2374
+ MinBranchesCount: 3
2375
+ Style/HashSyntax:
2376
+ Description: 'Prefer Ruby 1.9 hash syntax { a: 1, b: 2 } over 1.8 syntax { :a
2377
+ => 1, :b => 2 }.'
2378
+ Enabled: true
2379
+ EnforcedStyle: ruby19
2380
+ UseHashRocketsWithSymbolValues: false
2381
+ PreferHashRocketsForNonAlnumEndingSymbols: false
2382
+ Style/HashTransformKeys:
2383
+ Description: Prefer `transform_keys` over `each_with_object`, `map`, or `to_h`.
2384
+ Enabled: true
2385
+ Safe: false
2386
+ Style/HashTransformValues:
2387
+ Description: Prefer `transform_values` over `each_with_object`, `map`, or `to_h`.
2388
+ Enabled: true
2389
+ Safe: false
2390
+ Style/IdenticalConditionalBranches:
2391
+ Description: Checks that conditional statements do not have an identical line
2392
+ at the end of each branch, which can validly be moved out of the conditional.
2393
+ Enabled: true
2394
+ Style/IfInsideElse:
2395
+ Description: Finds if nodes inside else, which can be converted to elsif.
2396
+ Enabled: true
2397
+ AllowIfModifier: false
2398
+ Style/IfUnlessModifier:
2399
+ Description: Favor modifier if/unless usage when you have a single-line body.
2400
+ Enabled: true
2401
+ Style/IfUnlessModifierOfIfUnless:
2402
+ Description: Avoid modifier if/unless usage on conditionals.
2403
+ Enabled: true
2404
+ Style/IfWithSemicolon:
2405
+ Description: Do not use if x; .... Use the ternary operator instead.
2406
+ Enabled: true
2407
+ Style/ImplicitRuntimeError:
2408
+ Description: Use `raise` or `fail` with an explicit exception class and message,
2409
+ rather than just a message.
2410
+ Enabled: true
2411
+ Style/InfiniteLoop:
2412
+ Description: Use Kernel#loop for infinite loops.
2413
+ Enabled: true
2414
+ SafeAutoCorrect: true
2415
+ Style/InlineComment:
2416
+ Description: Avoid trailing inline comments.
2417
+ Enabled: true
2418
+ Style/InverseMethods:
2419
+ Description: Use the inverse method instead of `!.method` if an inverse method
2420
+ is defined.
2421
+ Enabled: true
2422
+ Safe: false
2423
+ InverseMethods:
2424
+ :any?: :none?
2425
+ :even?: :odd?
2426
+ :==: :!=
2427
+ :=~: :!~
2428
+ :<: :>=
2429
+ :>: :<=
2430
+ InverseBlocks:
2431
+ :select: :reject
2432
+ :select!: :reject!
2433
+ Style/IpAddresses:
2434
+ Description: Don't include literal IP addresses in code.
2435
+ Enabled: true
2436
+ AllowedAddresses:
2437
+ - "::"
2438
+ Style/KeywordParametersOrder:
2439
+ Description: Enforces that optional keyword parameters are placed at the end of
2440
+ the parameters list.
2441
+ Enabled: true
2442
+ Style/Lambda:
2443
+ Description: Use the new lambda literal syntax for single-line blocks.
2444
+ Enabled: true
2445
+ EnforcedStyle: line_count_dependent
2446
+ Style/LambdaCall:
2447
+ Description: Use lambda.call(...) instead of lambda.(...).
2448
+ Enabled: true
2449
+ EnforcedStyle: call
2450
+ Style/LineEndConcatenation:
2451
+ Description: Use \ instead of + or << to concatenate two string literals at line
2452
+ end.
2453
+ Enabled: true
2454
+ SafeAutoCorrect: false
2455
+ Style/MethodCallWithArgsParentheses:
2456
+ Description: Use parentheses for method calls with arguments.
2457
+ Enabled: true
2458
+ IgnoreMacros: true
2459
+ IgnoredMethods:
2460
+ - describe
2461
+ - context
2462
+ - it
2463
+ - to
2464
+ - not_to
2465
+ - require
2466
+ - require_relative
2467
+ - shared_examples
2468
+ - shared_context
2469
+ - define
2470
+ - yield
2471
+ - expect_with
2472
+ - mock_with
2473
+ IgnoredPatterns: []
2474
+ IncludedMacros: []
2475
+ AllowParenthesesInMultilineCall: false
2476
+ AllowParenthesesInChaining: false
2477
+ AllowParenthesesInCamelCaseMethod: false
2478
+ EnforcedStyle: require_parentheses
2479
+ Exclude:
2480
+ - Gemfile
2481
+ Style/MethodCallWithoutArgsParentheses:
2482
+ Description: Do not use parentheses for method calls with no arguments.
2483
+ Enabled: true
2484
+ IgnoredMethods: []
2485
+ Style/MethodCalledOnDoEndBlock:
2486
+ Description: Avoid chaining a method call on a do...end block.
2487
+ Enabled: true
2488
+ Style/MethodDefParentheses:
2489
+ Description: Checks if the method definitions have or don't have parentheses.
2490
+ Enabled: true
2491
+ EnforcedStyle: require_parentheses
2492
+ Style/MinMax:
2493
+ Description: Use `Enumerable#minmax` instead of `Enumerable#min` and `Enumerable#max`
2494
+ in conjunction.
2495
+ Enabled: true
2496
+ Style/MissingElse:
2497
+ Description: Require if/case expressions to have an else branches. If enabled,
2498
+ it is recommended that Style/UnlessElse and Style/EmptyElse be enabled. This
2499
+ will conflict with Style/EmptyElse if Style/EmptyElse is configured to style
2500
+ "both".
2501
+ Enabled: false
2502
+ EnforcedStyle: both
2503
+ Style/MissingRespondToMissing:
2504
+ Description: Checks if `method_missing` is implemented without implementing `respond_to_missing`.
2505
+ Enabled: true
2506
+ Style/MixinGrouping:
2507
+ Description: Checks for grouping of mixins in `class` and `module` bodies.
2508
+ Enabled: true
2509
+ EnforcedStyle: separated
2510
+ Style/MixinUsage:
2511
+ Description: Checks that `include`, `extend` and `prepend` exists at the top level.
2512
+ Enabled: true
2513
+ Style/ModuleFunction:
2514
+ Description: Checks for usage of `extend self` in modules.
2515
+ Enabled: true
2516
+ EnforcedStyle: module_function
2517
+ Autocorrect: false
2518
+ SafeAutoCorrect: false
2519
+ Style/MultilineBlockChain:
2520
+ Description: Avoid multi-line chains of blocks.
2521
+ Enabled: true
2522
+ Style/MultilineIfModifier:
2523
+ Description: Only use if/unless modifiers on single line statements.
2524
+ Enabled: true
2525
+ Style/MultilineIfThen:
2526
+ Description: Do not use then for multi-line if/unless.
2527
+ Enabled: true
2528
+ Style/MultilineMemoization:
2529
+ Description: Wrap multiline memoizations in a `begin` and `end` block.
2530
+ Enabled: true
2531
+ EnforcedStyle: keyword
2532
+ Style/MultilineMethodSignature:
2533
+ Description: Avoid multi-line method signatures.
2534
+ Enabled: true
2535
+ Style/MultilineTernaryOperator:
2536
+ Description: 'Avoid multi-line ?: (the ternary operator); use if/unless instead.'
2537
+ Enabled: true
2538
+ Style/MultilineWhenThen:
2539
+ Description: Do not use then for multi-line when statement.
2540
+ Enabled: true
2541
+ Style/MultipleComparison:
2542
+ Description: Avoid comparing a variable with multiple items in a conditional,
2543
+ use Array#include? instead.
2544
+ Enabled: true
2545
+ Style/MutableConstant:
2546
+ Description: Do not assign mutable objects to constants.
2547
+ Enabled: true
2548
+ EnforcedStyle: literals
2549
+ Style/NegatedIf:
2550
+ Description: Favor unless over if for negative conditions (or control flow or).
2551
+ Enabled: true
2552
+ EnforcedStyle: both
2553
+ Style/NegatedUnless:
2554
+ Description: Favor if over unless for negative conditions.
2555
+ Enabled: true
2556
+ EnforcedStyle: both
2557
+ Style/NegatedWhile:
2558
+ Description: Favor until over while for negative conditions.
2559
+ Enabled: true
2560
+ Style/NestedModifier:
2561
+ Description: Avoid using nested modifiers.
2562
+ Enabled: true
2563
+ Style/NestedParenthesizedCalls:
2564
+ Description: Parenthesize method calls which are nested inside the argument list
2565
+ of another parenthesized method call.
2566
+ Enabled: true
2567
+ AllowedMethods:
2568
+ - be
2569
+ - be_a
2570
+ - be_an
2571
+ - be_between
2572
+ - be_falsey
2573
+ - be_kind_of
2574
+ - be_instance_of
2575
+ - be_truthy
2576
+ - be_within
2577
+ - eq
2578
+ - eql
2579
+ - end_with
2580
+ - include
2581
+ - match
2582
+ - raise_error
2583
+ - respond_to
2584
+ - start_with
2585
+ Style/NestedTernaryOperator:
2586
+ Description: Use one expression per branch in a ternary operator.
2587
+ Enabled: true
2588
+ Style/Next:
2589
+ Description: Use `next` to skip iteration instead of a condition at the end.
2590
+ Enabled: true
2591
+ EnforcedStyle: skip_modifier_ifs
2592
+ MinBodyLength: 3
2593
+ Style/NilComparison:
2594
+ Description: Prefer x.nil? to x == nil.
2595
+ Enabled: true
2596
+ EnforcedStyle: predicate
2597
+ Style/NonNilCheck:
2598
+ Description: Checks for redundant nil checks.
2599
+ Enabled: true
2600
+ IncludeSemanticChanges: false
2601
+ Style/Not:
2602
+ Description: Use ! instead of not.
2603
+ Enabled: true
2604
+ Style/NumericLiteralPrefix:
2605
+ Description: Use smallcase prefixes for numeric literals.
2606
+ Enabled: true
2607
+ EnforcedOctalStyle: zero_with_o
2608
+ SupportedOctalStyles:
2609
+ - zero_with_o
2610
+ - zero_only
2611
+ Style/NumericLiterals:
2612
+ Description: Add underscores to large numeric literals to improve their readability.
2613
+ Enabled: true
2614
+ MinDigits: 5
2615
+ Strict: false
2616
+ Style/NumericPredicate:
2617
+ Description: Checks for the use of predicate- or comparison methods for numeric
2618
+ comparisons.
2619
+ Safe: false
2620
+ SafeAutoCorrect: false
2621
+ Enabled: true
2622
+ EnforcedStyle: predicate
2623
+ IgnoredMethods: []
2624
+ Exclude:
2625
+ - spec/**/*
2626
+ Style/OneLineConditional:
2627
+ Description: Favor the ternary operator (?:) or multi-line constructs over single-line
2628
+ if/then/else/end constructs.
2629
+ Enabled: true
2630
+ AlwaysCorrectToMultiline: false
2631
+ Style/OptionHash:
2632
+ Description: Don't use option hashes when you can use keyword arguments.
2633
+ Enabled: true
2634
+ SuspiciousParamNames:
2635
+ - options
2636
+ - opts
2637
+ - args
2638
+ - params
2639
+ - parameters
2640
+ Style/OptionalArguments:
2641
+ Description: Checks for optional arguments that do not appear at the end of the
2642
+ argument list.
2643
+ Enabled: true
2644
+ Safe: false
2645
+ Style/OptionalBooleanParameter:
2646
+ Description: Use keyword arguments when defining method with boolean argument.
2647
+ Enabled: true
2648
+ Safe: false
2649
+ Style/OrAssignment:
2650
+ Description: Recommend usage of double pipe equals (||=) where applicable.
2651
+ Enabled: true
2652
+ Style/ParallelAssignment:
2653
+ Description: Check for simple usages of parallel assignment. It will only warn
2654
+ when the number of variables matches on both sides of the assignment.
2655
+ Enabled: true
2656
+ Style/ParenthesesAroundCondition:
2657
+ Description: Don't use parentheses around the condition of an if/unless/while.
2658
+ Enabled: true
2659
+ AllowSafeAssignment: true
2660
+ AllowInMultilineConditions: false
2661
+ Style/PercentLiteralDelimiters:
2662
+ Description: Use `%`-literal delimiters consistently.
2663
+ Enabled: true
2664
+ PreferredDelimiters:
2665
+ default: "()"
2666
+ "%i": "[]"
2667
+ "%I": "[]"
2668
+ "%r": "{}"
2669
+ "%w": "[]"
2670
+ "%W": "[]"
2671
+ Style/PercentQLiterals:
2672
+ Description: Checks if uses of %Q/%q match the configured preference.
2673
+ Enabled: true
2674
+ EnforcedStyle: lower_case_q
2675
+ Style/PerlBackrefs:
2676
+ Description: Avoid Perl-style regex back references.
2677
+ Enabled: true
2678
+ Style/PreferredHashMethods:
2679
+ Description: Checks use of `has_key?` and `has_value?` Hash methods.
2680
+ Enabled: true
2681
+ Safe: false
2682
+ EnforcedStyle: short
2683
+ Style/Proc:
2684
+ Description: Use proc instead of Proc.new.
2685
+ Enabled: true
2686
+ Style/RaiseArgs:
2687
+ Description: Checks the arguments passed to raise/fail.
2688
+ Enabled: true
2689
+ EnforcedStyle: exploded
2690
+ Style/RandomWithOffset:
2691
+ Description: Prefer to use ranges when generating random numbers instead of integers
2692
+ with offsets.
2693
+ Enabled: true
2694
+ Style/RedundantAssignment:
2695
+ Description: Checks for redundant assignment before returning.
2696
+ Enabled: true
2697
+ Style/RedundantBegin:
2698
+ Description: Don't use begin blocks when they are not needed.
2699
+ Enabled: true
2700
+ Style/RedundantCapitalW:
2701
+ Description: Checks for %W when interpolation is not needed.
2702
+ Enabled: true
2703
+ Style/RedundantCondition:
2704
+ Description: Checks for unnecessary conditional expressions.
2705
+ Enabled: true
2706
+ Style/RedundantConditional:
2707
+ Description: Don't return true/false from a conditional.
2708
+ Enabled: true
2709
+ Style/RedundantException:
2710
+ Description: Checks for an obsolete RuntimeException argument in raise/fail.
2711
+ Enabled: true
2712
+ Style/RedundantFetchBlock:
2713
+ Description: Use `fetch(key, value)` instead of `fetch(key) { value }` when value
2714
+ has Numeric, Rational, Complex, Symbol or String type, `false`, `true`, `nil`
2715
+ or is a constant.
2716
+ Reference: https://github.com/JuanitoFatas/fast-ruby#hashfetch-with-argument-vs-hashfetch--block-code
2717
+ Enabled: true
2718
+ Safe: false
2719
+ SafeForConstants: false
2720
+ Style/RedundantFileExtensionInRequire:
2721
+ Description: Checks for the presence of superfluous `.rb` extension in the filename
2722
+ provided to `require` and `require_relative`.
2723
+ Enabled: true
2724
+ Style/RedundantFreeze:
2725
+ Description: Checks usages of Object#freeze on immutable objects.
2726
+ Enabled: true
2727
+ Style/RedundantInterpolation:
2728
+ Description: Checks for strings that are just an interpolated expression.
2729
+ Enabled: true
2730
+ Style/RedundantParentheses:
2731
+ Description: Checks for parentheses that seem not to serve any purpose.
2732
+ Enabled: true
2733
+ Style/RedundantPercentQ:
2734
+ Description: Checks for %q/%Q when single quotes or double quotes would do.
2735
+ Enabled: true
2736
+ Style/RedundantRegexpCharacterClass:
2737
+ Description: Checks for unnecessary single-element Regexp character classes.
2738
+ Enabled: true
2739
+ Style/RedundantRegexpEscape:
2740
+ Description: Checks for redundant escapes in Regexps.
2741
+ Enabled: true
2742
+ Style/RedundantReturn:
2743
+ Description: Don't use return where it's not required.
2744
+ Enabled: true
2745
+ AllowMultipleReturnValues: false
2746
+ Style/RedundantSelf:
2747
+ Description: Don't use self where it's not needed.
2748
+ Enabled: true
2749
+ Style/RedundantSelfAssignment:
2750
+ Description: Checks for places where redundant assignments are made for in place
2751
+ modification methods.
2752
+ Enabled: true
2753
+ Safe: false
2754
+ Style/RedundantSort:
2755
+ Description: Use `min` instead of `sort.first`, `max_by` instead of `sort_by...last`,
2756
+ etc.
2757
+ Enabled: true
2758
+ Style/RedundantSortBy:
2759
+ Description: Use `sort` instead of `sort_by { |x| x }`.
2760
+ Enabled: true
2761
+ Style/RegexpLiteral:
2762
+ Description: Use / or %r around regular expressions.
2763
+ Enabled: true
2764
+ EnforcedStyle: slashes
2765
+ AllowInnerSlashes: false
2766
+ Style/RescueModifier:
2767
+ Description: Avoid using rescue in its modifier form.
2768
+ Enabled: true
2769
+ Style/RescueStandardError:
2770
+ Description: Avoid rescuing without specifying an error class.
2771
+ Enabled: true
2772
+ EnforcedStyle: explicit
2773
+ Style/ReturnNil:
2774
+ Description: Use return instead of return nil.
2775
+ Enabled: true
2776
+ EnforcedStyle: return
2777
+ Style/SafeNavigation:
2778
+ Description: This cop transforms usages of a method call safeguarded by a check
2779
+ for the existence of the object to safe navigation (`&.`).
2780
+ Enabled: true
2781
+ ConvertCodeThatCanStartToReturnNil: false
2782
+ AllowedMethods:
2783
+ - present?
2784
+ - blank?
2785
+ - presence
2786
+ - try
2787
+ - try!
2788
+ Style/Sample:
2789
+ Description: Use `sample` instead of `shuffle.first`, `shuffle.last`, and `shuffle[Integer]`.
2790
+ Reference: https://github.com/JuanitoFatas/fast-ruby#arrayshufflefirst-vs-arraysample-code
2791
+ Enabled: true
2792
+ Style/SelfAssignment:
2793
+ Description: Checks for places where self-assignment shorthand should have been
2794
+ used.
2795
+ Enabled: true
2796
+ Style/Semicolon:
2797
+ Description: Don't use semicolons to terminate expressions.
2798
+ Enabled: true
2799
+ AllowAsExpressionSeparator: false
2800
+ Style/Send:
2801
+ Description: Prefer `Object#__send__` or `Object#public_send` to `send`, as `send`
2802
+ may overlap with existing methods.
2803
+ Enabled: true
2804
+ Style/SignalException:
2805
+ Description: Checks for proper usage of fail and raise.
2806
+ Enabled: true
2807
+ EnforcedStyle: only_raise
2808
+ Style/SingleArgumentDig:
2809
+ Description: Avoid using single argument dig method.
2810
+ Enabled: true
2811
+ Safe: false
2812
+ Style/SingleLineBlockParams:
2813
+ Description: Enforces the names of some block params.
2814
+ Enabled: true
2815
+ Methods:
2816
+ - reduce:
2817
+ - accumlator
2818
+ - element
2819
+ Style/SingleLineMethods:
2820
+ Description: Avoid single-line methods.
2821
+ Enabled: true
2822
+ AllowIfMethodIsEmpty: true
2823
+ Style/SlicingWithRange:
2824
+ Description: Checks array slicing is done with endless ranges when suitable.
2825
+ Enabled: true
2826
+ Safe: false
2827
+ Style/SoleNestedConditional:
2828
+ Description: Finds sole nested conditional nodes which can be merged into outer
2829
+ conditional node.
2830
+ Enabled: true
2831
+ AllowModifier: false
2832
+ Style/SpecialGlobalVars:
2833
+ Description: Avoid Perl-style global variables.
2834
+ Enabled: true
2835
+ SafeAutoCorrect: false
2836
+ EnforcedStyle: use_english_names
2837
+ Style/StabbyLambdaParentheses:
2838
+ Description: Check for the usage of parentheses around stabby lambda arguments.
2839
+ Enabled: true
2840
+ EnforcedStyle: require_parentheses
2841
+ Style/StderrPuts:
2842
+ Description: Use `warn` instead of `$stderr.puts`.
2843
+ Enabled: true
2844
+ Style/StringConcatenation:
2845
+ Description: Checks for places where string concatenation can be replaced with
2846
+ string interpolation.
2847
+ Enabled: true
2848
+ Safe: false
2849
+ Style/StringHashKeys:
2850
+ Description: Prefer symbols instead of strings as hash keys.
2851
+ Enabled: true
2852
+ Safe: false
2853
+ Style/StringLiterals:
2854
+ Description: Checks if uses of quotes match the configured preference.
2855
+ Enabled: true
2856
+ EnforcedStyle: single_quotes
2857
+ ConsistentQuotesInMultiline: false
2858
+ Style/StringLiteralsInInterpolation:
2859
+ Description: Checks if uses of quotes inside expressions in interpolated strings
2860
+ match the configured preference.
2861
+ Enabled: true
2862
+ EnforcedStyle: single_quotes
2863
+ Style/StringMethods:
2864
+ Description: Checks if configured preferred methods are used over non-preferred.
2865
+ Enabled: true
2866
+ PreferredMethods:
2867
+ intern: to_sym
2868
+ Style/Strip:
2869
+ Description: Use `strip` instead of `lstrip.rstrip`.
2870
+ Enabled: true
2871
+ Style/StructInheritance:
2872
+ Description: Checks for inheritance from Struct.new.
2873
+ Enabled: true
2874
+ Style/SymbolArray:
2875
+ Description: Use %i or %I for arrays of symbols.
2876
+ Enabled: true
2877
+ EnforcedStyle: percent
2878
+ MinSize: 1
2879
+ Style/SymbolLiteral:
2880
+ Description: Use plain symbols instead of string symbols when possible.
2881
+ Enabled: true
2882
+ Style/SymbolProc:
2883
+ Description: Use symbols as procs instead of blocks when possible.
2884
+ Enabled: true
2885
+ Safe: false
2886
+ IgnoredMethods:
2887
+ - respond_to
2888
+ - define_method
2889
+ Style/TernaryParentheses:
2890
+ Description: Checks for use of parentheses around ternary conditions.
2891
+ Enabled: true
2892
+ EnforcedStyle: require_no_parentheses
2893
+ AllowSafeAssignment: true
2894
+ Style/TrailingBodyOnClass:
2895
+ Description: Class body goes below class statement.
2896
+ Enabled: true
2897
+ Style/TrailingBodyOnMethodDefinition:
2898
+ Description: Method body goes below definition.
2899
+ Enabled: true
2900
+ Style/TrailingBodyOnModule:
2901
+ Description: Module body goes below module statement.
2902
+ Enabled: true
2903
+ Style/TrailingCommaInArguments:
2904
+ Description: Checks for trailing comma in argument lists.
2905
+ Enabled: true
2906
+ EnforcedStyleForMultiline: no_comma
2907
+ SupportedStylesForMultiline:
2908
+ - comma
2909
+ - consistent_comma
2910
+ - no_comma
2911
+ Style/TrailingCommaInArrayLiteral:
2912
+ Description: Checks for trailing comma in array literals.
2913
+ Enabled: true
2914
+ EnforcedStyleForMultiline: no_comma
2915
+ SupportedStylesForMultiline:
2916
+ - comma
2917
+ - consistent_comma
2918
+ - no_comma
2919
+ Style/TrailingCommaInBlockArgs:
2920
+ Description: Checks for useless trailing commas in block arguments.
2921
+ Enabled: true
2922
+ Safe: false
2923
+ Style/TrailingCommaInHashLiteral:
2924
+ Description: Checks for trailing comma in hash literals.
2925
+ Enabled: true
2926
+ EnforcedStyleForMultiline: no_comma
2927
+ SupportedStylesForMultiline:
2928
+ - comma
2929
+ - consistent_comma
2930
+ - no_comma
2931
+ Style/TrailingMethodEndStatement:
2932
+ Description: Checks for trailing end statement on line of method body.
2933
+ Enabled: true
2934
+ Style/TrailingUnderscoreVariable:
2935
+ Description: Checks for the usage of unneeded trailing underscores at the end
2936
+ of parallel variable assignment.
2937
+ AllowNamedUnderscoreVariables: true
2938
+ Enabled: true
2939
+ Style/TrivialAccessors:
2940
+ Description: Prefer attr_* methods to trivial readers/writers.
2941
+ Enabled: true
2942
+ ExactNameMatch: true
2943
+ AllowPredicates: true
2944
+ AllowDSLWriters: false
2945
+ IgnoreClassMethods: false
2946
+ AllowedMethods:
2947
+ - to_ary
2948
+ - to_a
2949
+ - to_c
2950
+ - to_enum
2951
+ - to_h
2952
+ - to_hash
2953
+ - to_i
2954
+ - to_int
2955
+ - to_io
2956
+ - to_open
2957
+ - to_path
2958
+ - to_proc
2959
+ - to_r
2960
+ - to_regexp
2961
+ - to_str
2962
+ - to_s
2963
+ - to_sym
2964
+ Style/UnlessElse:
2965
+ Description: Do not use unless with else. Rewrite these with the positive case
2966
+ first.
2967
+ Enabled: true
2968
+ Style/UnpackFirst:
2969
+ Description: Checks for accessing the first element of `String#unpack` instead
2970
+ of using `unpack1`.
2971
+ Enabled: true
2972
+ Style/VariableInterpolation:
2973
+ Description: Don't interpolate global, instance and class variables directly in
2974
+ strings.
2975
+ Enabled: true
2976
+ Style/WhenThen:
2977
+ Description: Use when x then ... for one-line cases.
2978
+ Enabled: true
2979
+ Style/WhileUntilDo:
2980
+ Description: Checks for redundant do after while or until.
2981
+ Enabled: true
2982
+ Style/WhileUntilModifier:
2983
+ Description: Favor modifier while/until usage when you have a single-line body.
2984
+ Enabled: true
2985
+ Style/WordArray:
2986
+ Description: Use %w or %W for arrays of words.
2987
+ Enabled: true
2988
+ EnforcedStyle: percent
2989
+ MinSize: 1
2990
+ WordRegex: !ruby/regexp /\A(?:\p{Word}|\p{Word}-\p{Word}|\n|\t)+\z/
2991
+ Style/YodaCondition:
2992
+ Description: Forbid or enforce yoda conditions.
2993
+ Reference: https://en.wikipedia.org/wiki/Yoda_conditions
2994
+ Enabled: true
2995
+ EnforcedStyle: forbid_for_all_comparison_operators
2996
+ Safe: false
2997
+ Style/ZeroLengthPredicate:
2998
+ Description: 'Use #empty? when testing for objects of length 0.'
2999
+ Enabled: true
3000
+ Safe: false