danger-ormolu 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: eda05b796b5859ec47645b756e790bcf74eb8728e5743852514f452c9de2ddda
4
+ data.tar.gz: 9844706faf4fc9460d8064333236aadb17f804a7c253a2fff6ffc9ee335c85eb
5
+ SHA512:
6
+ metadata.gz: f6e7cb24c68611e7c4e3dce3bbaa8a3d776907877a01c4c041acd3ceb8ad7d3a2b193cffef9d214f7ddd50234820a9f660690b7a57a1e6ec46215737586b414a
7
+ data.tar.gz: '0289eb2235ed08d737e69a66d9bf7ece07fa12416908068487a4303bbf2e8b9377071a97315b25fd97c83e3091c12896b15a8d5ab23ed9bbf6b1c56a81520b0f'
data/.gitignore ADDED
@@ -0,0 +1,4 @@
1
+ .DS_Store
2
+ pkg
3
+ .idea/
4
+ .yardoc
data/.rubocop.yml ADDED
@@ -0,0 +1,4796 @@
1
+ # Common configuration.
2
+
3
+ AllCops:
4
+ RubyInterpreters:
5
+ - ruby
6
+ - macruby
7
+ - rake
8
+ - jruby
9
+ - rbx
10
+ # Include common Ruby source files.
11
+ Include:
12
+ - '**/*.rb'
13
+ - '**/*.arb'
14
+ - '**/*.axlsx'
15
+ - '**/*.builder'
16
+ - '**/*.fcgi'
17
+ - '**/*.gemfile'
18
+ - '**/*.gemspec'
19
+ - '**/*.god'
20
+ - '**/*.jb'
21
+ - '**/*.jbuilder'
22
+ - '**/*.mspec'
23
+ - '**/*.opal'
24
+ - '**/*.pluginspec'
25
+ - '**/*.podspec'
26
+ - '**/*.rabl'
27
+ - '**/*.rake'
28
+ - '**/*.rbuild'
29
+ - '**/*.rbw'
30
+ - '**/*.rbx'
31
+ - '**/*.ru'
32
+ - '**/*.ruby'
33
+ - '**/*.spec'
34
+ - '**/*.thor'
35
+ - '**/*.watchr'
36
+ - '**/.irbrc'
37
+ - '**/.pryrc'
38
+ - '**/.simplecov'
39
+ - '**/buildfile'
40
+ - '**/Appraisals'
41
+ - '**/Berksfile'
42
+ - '**/Brewfile'
43
+ - '**/Buildfile'
44
+ - '**/Capfile'
45
+ - '**/Cheffile'
46
+ - '**/Dangerfile'
47
+ - '**/Deliverfile'
48
+ - '**/Fastfile'
49
+ - '**/*Fastfile'
50
+ - '**/Gemfile'
51
+ - '**/Guardfile'
52
+ - '**/Jarfile'
53
+ - '**/Mavenfile'
54
+ - '**/Podfile'
55
+ - '**/Puppetfile'
56
+ - '**/Rakefile'
57
+ - '**/rakefile'
58
+ - '**/Snapfile'
59
+ - '**/Steepfile'
60
+ - '**/Thorfile'
61
+ - '**/Vagabondfile'
62
+ - '**/Vagrantfile'
63
+ Exclude:
64
+ - 'node_modules/**/*'
65
+ - 'tmp/**/*'
66
+ - 'vendor/**/*'
67
+ - '.git/**/*'
68
+ # Default formatter will be used if no `-f/--format` option is given.
69
+ DefaultFormatter: progress
70
+ # Cop names are displayed in offense messages by default. Change behavior
71
+ # by overriding DisplayCopNames, or by giving the `--no-display-cop-names`
72
+ # option.
73
+ DisplayCopNames: true
74
+ # Style guide URLs are not displayed in offense messages by default. Change
75
+ # behavior by overriding `DisplayStyleGuide`, or by giving the
76
+ # `-S/--display-style-guide` option.
77
+ DisplayStyleGuide: false
78
+ # When specifying style guide URLs, any paths and/or fragments will be
79
+ # evaluated relative to the base URL.
80
+ StyleGuideBaseURL: https://rubystyle.guide
81
+ # Extra details are not displayed in offense messages by default. Change
82
+ # behavior by overriding ExtraDetails, or by giving the
83
+ # `-E/--extra-details` option.
84
+ ExtraDetails: false
85
+ # Additional cops that do not reference a style guide rule may be enabled by
86
+ # default. Change behavior by overriding `StyleGuideCopsOnly`, or by giving
87
+ # the `--only-guide-cops` option.
88
+ StyleGuideCopsOnly: false
89
+ # All cops except the ones configured `Enabled: false` in this file are enabled by default.
90
+ # Change this behavior by overriding either `DisabledByDefault` or `EnabledByDefault`.
91
+ # When `DisabledByDefault` is `true`, all cops in the default configuration
92
+ # are disabled, and only cops in user configuration are enabled. This makes
93
+ # cops opt-in instead of opt-out. Note that when `DisabledByDefault` is `true`,
94
+ # cops in user configuration will be enabled even if they don't set the
95
+ # Enabled parameter.
96
+ # When `EnabledByDefault` is `true`, all cops, even those configured `Enabled: false`
97
+ # in this file are enabled by default. Cops can still be disabled in user configuration.
98
+ # Note that it is invalid to set both EnabledByDefault and DisabledByDefault
99
+ # to true in the same configuration.
100
+ EnabledByDefault: false
101
+ DisabledByDefault: false
102
+ # New cops introduced between major versions are set to a special pending status
103
+ # and are not enabled by default with warning message.
104
+ # Change this behavior by overriding either `NewCops: enable` or `NewCops: disable`.
105
+ # When `NewCops` is `enable`, pending cops are enabled in bulk. Can be overridden by
106
+ # the `--enable-pending-cops` command-line option.
107
+ # When `NewCops` is `disable`, pending cops are disabled in bulk. Can be overridden by
108
+ # the `--disable-pending-cops` command-line option.
109
+ NewCops: pending
110
+ # Enables the result cache if `true`. Can be overridden by the `--cache` command
111
+ # line option.
112
+ UseCache: true
113
+ # Threshold for how many files can be stored in the result cache before some
114
+ # of the files are automatically removed.
115
+ MaxFilesInCache: 20000
116
+ # The cache will be stored in "rubocop_cache" under this directory. If
117
+ # CacheRootDirectory is ~ (nil), which it is by default, the root will be
118
+ # taken from the environment variable `$XDG_CACHE_HOME` if it is set, or if
119
+ # `$XDG_CACHE_HOME` is not set, it will be `$HOME/.cache/`.
120
+ # The CacheRootDirectory can be overwritten by passing the `--cache-root` command
121
+ # line option or by setting `$RUBOCOP_CACHE_ROOT` environment variable.
122
+ CacheRootDirectory: ~
123
+ # It is possible for a malicious user to know the location of RuboCop's cache
124
+ # directory by looking at CacheRootDirectory, and create a symlink in its
125
+ # place that could cause RuboCop to overwrite unintended files, or read
126
+ # malicious input. If you are certain that your cache location is secure from
127
+ # this kind of attack, and wish to use a symlinked cache location, set this
128
+ # value to "true".
129
+ AllowSymlinksInCacheRootDirectory: false
130
+ # What MRI version of the Ruby interpreter is the inspected code intended to
131
+ # run on? (If there is more than one, set this to the lowest version.)
132
+ # If a value is specified for TargetRubyVersion then it is used. Acceptable
133
+ # values are specificed as a float (i.e. 2.5); the teeny version of Ruby
134
+ # should not be included. If the project specifies a Ruby version in the
135
+ # .tool-versions or .ruby-version files, Gemfile or gems.rb file, RuboCop will
136
+ # try to determine the desired version of Ruby by inspecting the
137
+ # .tool-versions file first, then .ruby-version, followed by the Gemfile.lock
138
+ # or gems.locked file. (Although the Ruby version is specified in the Gemfile
139
+ # or gems.rb file, RuboCop reads the final value from the lock file.) If the
140
+ # Ruby version is still unresolved, RuboCop will use the oldest officially
141
+ # supported Ruby version (currently Ruby 2.4).
142
+ TargetRubyVersion: ~
143
+ # Determines if a notification for extension libraries should be shown when
144
+ # rubocop is run. Keys are the name of the extension, and values are an array
145
+ # of gems in the Gemfile that the extension is suggested for, if not already
146
+ # included.
147
+ SuggestExtensions:
148
+ rubocop-rails: [rails]
149
+ rubocop-rspec: [rspec, rspec-rails]
150
+ rubocop-minitest: [minitest]
151
+ rubocop-sequel: [sequel]
152
+ rubocop-rake: [rake]
153
+
154
+ #################### Bundler ###############################
155
+
156
+ Bundler/DuplicatedGem:
157
+ Description: 'Checks for duplicate gem entries in Gemfile.'
158
+ Enabled: true
159
+ VersionAdded: '0.46'
160
+ Include:
161
+ - '**/*.gemfile'
162
+ - '**/Gemfile'
163
+ - '**/gems.rb'
164
+
165
+ Bundler/GemComment:
166
+ Description: 'Add a comment describing each gem.'
167
+ Enabled: false
168
+ VersionAdded: '0.59'
169
+ VersionChanged: '0.85'
170
+ Include:
171
+ - '**/*.gemfile'
172
+ - '**/Gemfile'
173
+ - '**/gems.rb'
174
+ IgnoredGems: []
175
+ OnlyFor: []
176
+
177
+ Bundler/InsecureProtocolSource:
178
+ Description: >-
179
+ The source `:gemcutter`, `:rubygems` and `:rubyforge` are deprecated
180
+ because HTTP requests are insecure. Please change your source to
181
+ 'https://rubygems.org' if possible, or 'http://rubygems.org' if not.
182
+ Enabled: true
183
+ VersionAdded: '0.50'
184
+ Include:
185
+ - '**/*.gemfile'
186
+ - '**/Gemfile'
187
+ - '**/gems.rb'
188
+
189
+ Bundler/OrderedGems:
190
+ Description: >-
191
+ Gems within groups in the Gemfile should be alphabetically sorted.
192
+ Enabled: true
193
+ VersionAdded: '0.46'
194
+ VersionChanged: '0.47'
195
+ TreatCommentsAsGroupSeparators: true
196
+ # By default, "-" and "_" are ignored for order purposes.
197
+ # This can be overridden by setting this parameter to true.
198
+ ConsiderPunctuation: false
199
+ Include:
200
+ - '**/*.gemfile'
201
+ - '**/Gemfile'
202
+ - '**/gems.rb'
203
+
204
+ #################### Gemspec ###############################
205
+
206
+ Gemspec/DuplicatedAssignment:
207
+ Description: 'An attribute assignment method calls should be listed only once in a gemspec.'
208
+ Enabled: true
209
+ VersionAdded: '0.52'
210
+ Include:
211
+ - '**/*.gemspec'
212
+
213
+ Gemspec/OrderedDependencies:
214
+ Description: >-
215
+ Dependencies in the gemspec should be alphabetically sorted.
216
+ Enabled: true
217
+ VersionAdded: '0.51'
218
+ TreatCommentsAsGroupSeparators: true
219
+ # By default, "-" and "_" are ignored for order purposes.
220
+ # This can be overridden by setting this parameter to true.
221
+ ConsiderPunctuation: false
222
+ Include:
223
+ - '**/*.gemspec'
224
+
225
+ Gemspec/RequiredRubyVersion:
226
+ Description: 'Checks that `required_ruby_version` of gemspec is specified and equal to `TargetRubyVersion` of .rubocop.yml.'
227
+ Enabled: true
228
+ VersionAdded: '0.52'
229
+ VersionChanged: '0.89'
230
+ Include:
231
+ - '**/*.gemspec'
232
+
233
+ Gemspec/RubyVersionGlobalsUsage:
234
+ Description: Checks usage of RUBY_VERSION in gemspec.
235
+ StyleGuide: '#no-ruby-version-in-the-gemspec'
236
+ Enabled: true
237
+ VersionAdded: '0.72'
238
+ Include:
239
+ - '**/*.gemspec'
240
+
241
+ #################### Layout ###########################
242
+
243
+ Layout/AccessModifierIndentation:
244
+ Description: Check indentation of private/protected visibility modifiers.
245
+ StyleGuide: '#indent-public-private-protected'
246
+ Enabled: true
247
+ VersionAdded: '0.49'
248
+ EnforcedStyle: indent
249
+ SupportedStyles:
250
+ - outdent
251
+ - indent
252
+ # By default, the indentation width from Layout/IndentationWidth is used
253
+ # But it can be overridden by setting this parameter
254
+ IndentationWidth: ~
255
+
256
+ Layout/ArgumentAlignment:
257
+ Description: >-
258
+ Align the arguments of a method call if they span more
259
+ than one line.
260
+ StyleGuide: '#no-double-indent'
261
+ Enabled: true
262
+ VersionAdded: '0.68'
263
+ VersionChanged: '0.77'
264
+ # Alignment of arguments in multi-line method calls.
265
+ #
266
+ # The `with_first_argument` style aligns the following lines along the same
267
+ # column as the first parameter.
268
+ #
269
+ # method_call(a,
270
+ # b)
271
+ #
272
+ # The `with_fixed_indentation` style aligns the following lines with one
273
+ # level of indentation relative to the start of the line with the method call.
274
+ #
275
+ # method_call(a,
276
+ # b)
277
+ EnforcedStyle: with_first_argument
278
+ SupportedStyles:
279
+ - with_first_argument
280
+ - with_fixed_indentation
281
+ # By default, the indentation width from Layout/IndentationWidth is used
282
+ # But it can be overridden by setting this parameter
283
+ IndentationWidth: ~
284
+
285
+ Layout/ArrayAlignment:
286
+ Description: >-
287
+ Align the elements of an array literal if they span more than
288
+ one line.
289
+ StyleGuide: '#no-double-indent'
290
+ Enabled: true
291
+ VersionAdded: '0.49'
292
+ VersionChanged: '0.77'
293
+ # Alignment of elements of a multi-line array.
294
+ #
295
+ # The `with_first_parameter` style aligns the following lines along the same
296
+ # column as the first element.
297
+ #
298
+ # array = [1, 2, 3,
299
+ # 4, 5, 6]
300
+ #
301
+ # The `with_fixed_indentation` style aligns the following lines with one
302
+ # level of indentation relative to the start of the line with start of array.
303
+ #
304
+ # array = [1, 2, 3,
305
+ # 4, 5, 6]
306
+ EnforcedStyle: with_first_element
307
+ SupportedStyles:
308
+ - with_first_element
309
+ - with_fixed_indentation
310
+ # By default, the indentation width from Layout/IndentationWidth is used
311
+ # But it can be overridden by setting this parameter
312
+ IndentationWidth: ~
313
+
314
+ Layout/AssignmentIndentation:
315
+ Description: >-
316
+ Checks the indentation of the first line of the
317
+ right-hand-side of a multi-line assignment.
318
+ Enabled: true
319
+ VersionAdded: '0.49'
320
+ VersionChanged: '0.77'
321
+ # By default, the indentation width from `Layout/IndentationWidth` is used
322
+ # But it can be overridden by setting this parameter
323
+ IndentationWidth: ~
324
+
325
+ Layout/BeginEndAlignment:
326
+ Description: 'Align ends corresponding to begins correctly.'
327
+ Enabled: true
328
+ VersionAdded: '0.91'
329
+ # The value `start_of_line` means that `end` should be aligned the start of the line
330
+ # where the `begin` keyword is.
331
+ # The value `begin` means that `end` should be aligned with the `begin` keyword.
332
+ EnforcedStyleAlignWith: start_of_line
333
+ SupportedStylesAlignWith:
334
+ - start_of_line
335
+ - begin
336
+ Severity: warning
337
+
338
+ Layout/BlockAlignment:
339
+ Description: 'Align block ends correctly.'
340
+ Enabled: true
341
+ VersionAdded: '0.53'
342
+ # The value `start_of_block` means that the `end` should be aligned with line
343
+ # where the `do` keyword appears.
344
+ # The value `start_of_line` means it should be aligned with the whole
345
+ # expression's starting line.
346
+ # The value `either` means both are allowed.
347
+ EnforcedStyleAlignWith: either
348
+ SupportedStylesAlignWith:
349
+ - either
350
+ - start_of_block
351
+ - start_of_line
352
+
353
+ Layout/BlockEndNewline:
354
+ Description: 'Put end statement of multiline block on its own line.'
355
+ Enabled: true
356
+ VersionAdded: '0.49'
357
+
358
+ Layout/CaseIndentation:
359
+ Description: 'Indentation of when in a case/when/[else/]end.'
360
+ StyleGuide: '#indent-when-to-case'
361
+ Enabled: true
362
+ VersionAdded: '0.49'
363
+ EnforcedStyle: case
364
+ SupportedStyles:
365
+ - case
366
+ - end
367
+ IndentOneStep: false
368
+ # By default, the indentation width from `Layout/IndentationWidth` is used.
369
+ # But it can be overridden by setting this parameter.
370
+ # This only matters if `IndentOneStep` is `true`
371
+ IndentationWidth: ~
372
+
373
+ Layout/ClassStructure:
374
+ Description: 'Enforces a configured order of definitions within a class body.'
375
+ StyleGuide: '#consistent-classes'
376
+ Enabled: false
377
+ VersionAdded: '0.52'
378
+ Categories:
379
+ module_inclusion:
380
+ - include
381
+ - prepend
382
+ - extend
383
+ ExpectedOrder:
384
+ - module_inclusion
385
+ - constants
386
+ - public_class_methods
387
+ - initializer
388
+ - public_methods
389
+ - protected_methods
390
+ - private_methods
391
+
392
+ Layout/ClosingHeredocIndentation:
393
+ Description: 'Checks the indentation of here document closings.'
394
+ Enabled: true
395
+ VersionAdded: '0.57'
396
+
397
+ Layout/ClosingParenthesisIndentation:
398
+ Description: 'Checks the indentation of hanging closing parentheses.'
399
+ Enabled: true
400
+ VersionAdded: '0.49'
401
+
402
+ Layout/CommentIndentation:
403
+ Description: 'Indentation of comments.'
404
+ Enabled: true
405
+ VersionAdded: '0.49'
406
+
407
+ Layout/ConditionPosition:
408
+ Description: >-
409
+ Checks for condition placed in a confusing position relative to
410
+ the keyword.
411
+ StyleGuide: '#same-line-condition'
412
+ Enabled: true
413
+ VersionAdded: '0.53'
414
+ VersionChanged: '0.83'
415
+
416
+ Layout/DefEndAlignment:
417
+ Description: 'Align ends corresponding to defs correctly.'
418
+ Enabled: true
419
+ VersionAdded: '0.53'
420
+ # The value `def` means that `end` should be aligned with the def keyword.
421
+ # The value `start_of_line` means that `end` should be aligned with method
422
+ # calls like `private`, `public`, etc, if present in front of the `def`
423
+ # keyword on the same line.
424
+ EnforcedStyleAlignWith: start_of_line
425
+ SupportedStylesAlignWith:
426
+ - start_of_line
427
+ - def
428
+ Severity: warning
429
+
430
+ Layout/DotPosition:
431
+ Description: 'Checks the position of the dot in multi-line method calls.'
432
+ StyleGuide: '#consistent-multi-line-chains'
433
+ Enabled: true
434
+ VersionAdded: '0.49'
435
+ EnforcedStyle: leading
436
+ SupportedStyles:
437
+ - leading
438
+ - trailing
439
+
440
+ Layout/ElseAlignment:
441
+ Description: 'Align elses and elsifs correctly.'
442
+ Enabled: true
443
+ VersionAdded: '0.49'
444
+
445
+ Layout/EmptyComment:
446
+ Description: 'Checks empty comment.'
447
+ Enabled: true
448
+ VersionAdded: '0.53'
449
+ AllowBorderComment: true
450
+ AllowMarginComment: true
451
+
452
+ Layout/EmptyLineAfterGuardClause:
453
+ Description: 'Add empty line after guard clause.'
454
+ Enabled: true
455
+ VersionAdded: '0.56'
456
+ VersionChanged: '0.59'
457
+
458
+ Layout/EmptyLineAfterMagicComment:
459
+ Description: 'Add an empty line after magic comments to separate them from code.'
460
+ StyleGuide: '#separate-magic-comments-from-code'
461
+ Enabled: true
462
+ VersionAdded: '0.49'
463
+
464
+ Layout/EmptyLineAfterMultilineCondition:
465
+ Description: 'Enforces empty line after multiline condition.'
466
+ # This is disabled, because this style is not very common in practice.
467
+ Enabled: false
468
+ VersionAdded: '0.90'
469
+ Reference:
470
+ - https://github.com/airbnb/ruby#multiline-if-newline
471
+
472
+ Layout/EmptyLineBetweenDefs:
473
+ Description: 'Use empty lines between class/module/method defs.'
474
+ StyleGuide: '#empty-lines-between-methods'
475
+ Enabled: true
476
+ VersionAdded: '0.49'
477
+ VersionChanged: '1.7'
478
+ EmptyLineBetweenMethodDefs: true
479
+ EmptyLineBetweenClassDefs: true
480
+ EmptyLineBetweenModuleDefs: true
481
+ # If `true`, this parameter means that single line method definitions don't
482
+ # need an empty line between them.
483
+ AllowAdjacentOneLineDefs: false
484
+ # Can be array to specify minimum and maximum number of empty lines, e.g. [1, 2]
485
+ NumberOfEmptyLines: 1
486
+
487
+ Layout/EmptyLines:
488
+ Description: "Don't use several empty lines in a row."
489
+ StyleGuide: '#two-or-more-empty-lines'
490
+ Enabled: true
491
+ VersionAdded: '0.49'
492
+
493
+ Layout/EmptyLinesAroundAccessModifier:
494
+ Description: "Keep blank lines around access modifiers."
495
+ StyleGuide: '#empty-lines-around-access-modifier'
496
+ Enabled: true
497
+ VersionAdded: '0.49'
498
+ EnforcedStyle: around
499
+ SupportedStyles:
500
+ - around
501
+ - only_before
502
+ Reference:
503
+ # A reference to `EnforcedStyle: only_before`.
504
+ - https://edgeguides.rubyonrails.org/contributing_to_ruby_on_rails.html#follow-the-coding-conventions
505
+
506
+ Layout/EmptyLinesAroundArguments:
507
+ Description: "Keeps track of empty lines around method arguments."
508
+ Enabled: true
509
+ VersionAdded: '0.52'
510
+
511
+ Layout/EmptyLinesAroundAttributeAccessor:
512
+ Description: "Keep blank lines around attribute accessors."
513
+ StyleGuide: '#empty-lines-around-attribute-accessor'
514
+ Enabled: true
515
+ VersionAdded: '0.83'
516
+ VersionChanged: '0.84'
517
+ AllowAliasSyntax: true
518
+ AllowedMethods:
519
+ - alias_method
520
+ - public
521
+ - protected
522
+ - private
523
+
524
+ Layout/EmptyLinesAroundBeginBody:
525
+ Description: "Keeps track of empty lines around begin-end bodies."
526
+ StyleGuide: '#empty-lines-around-bodies'
527
+ Enabled: true
528
+ VersionAdded: '0.49'
529
+
530
+ Layout/EmptyLinesAroundBlockBody:
531
+ Description: "Keeps track of empty lines around block bodies."
532
+ StyleGuide: '#empty-lines-around-bodies'
533
+ Enabled: true
534
+ VersionAdded: '0.49'
535
+ EnforcedStyle: no_empty_lines
536
+ SupportedStyles:
537
+ - empty_lines
538
+ - no_empty_lines
539
+
540
+ Layout/EmptyLinesAroundClassBody:
541
+ Description: "Keeps track of empty lines around class bodies."
542
+ StyleGuide: '#empty-lines-around-bodies'
543
+ Enabled: true
544
+ VersionAdded: '0.49'
545
+ VersionChanged: '0.53'
546
+ EnforcedStyle: no_empty_lines
547
+ SupportedStyles:
548
+ - empty_lines
549
+ - empty_lines_except_namespace
550
+ - empty_lines_special
551
+ - no_empty_lines
552
+ - beginning_only
553
+ - ending_only
554
+
555
+ Layout/EmptyLinesAroundExceptionHandlingKeywords:
556
+ Description: "Keeps track of empty lines around exception handling keywords."
557
+ StyleGuide: '#empty-lines-around-bodies'
558
+ Enabled: true
559
+ VersionAdded: '0.49'
560
+
561
+ Layout/EmptyLinesAroundMethodBody:
562
+ Description: "Keeps track of empty lines around method bodies."
563
+ StyleGuide: '#empty-lines-around-bodies'
564
+ Enabled: true
565
+ VersionAdded: '0.49'
566
+
567
+ Layout/EmptyLinesAroundModuleBody:
568
+ Description: "Keeps track of empty lines around module bodies."
569
+ StyleGuide: '#empty-lines-around-bodies'
570
+ Enabled: true
571
+ VersionAdded: '0.49'
572
+ EnforcedStyle: no_empty_lines
573
+ SupportedStyles:
574
+ - empty_lines
575
+ - empty_lines_except_namespace
576
+ - empty_lines_special
577
+ - no_empty_lines
578
+
579
+ Layout/EndAlignment:
580
+ Description: 'Align ends correctly.'
581
+ Enabled: true
582
+ VersionAdded: '0.53'
583
+ # The value `keyword` means that `end` should be aligned with the matching
584
+ # keyword (`if`, `while`, etc.).
585
+ # The value `variable` means that in assignments, `end` should be aligned
586
+ # with the start of the variable on the left hand side of `=`. In all other
587
+ # situations, `end` should still be aligned with the keyword.
588
+ # The value `start_of_line` means that `end` should be aligned with the start
589
+ # of the line which the matching keyword appears on.
590
+ EnforcedStyleAlignWith: keyword
591
+ SupportedStylesAlignWith:
592
+ - keyword
593
+ - variable
594
+ - start_of_line
595
+ Severity: warning
596
+
597
+ Layout/EndOfLine:
598
+ Description: 'Use Unix-style line endings.'
599
+ StyleGuide: '#crlf'
600
+ Enabled: true
601
+ VersionAdded: '0.49'
602
+ # The `native` style means that CR+LF (Carriage Return + Line Feed) is
603
+ # enforced on Windows, and LF is enforced on other platforms. The other styles
604
+ # mean LF and CR+LF, respectively.
605
+ EnforcedStyle: native
606
+ SupportedStyles:
607
+ - native
608
+ - lf
609
+ - crlf
610
+
611
+ Layout/ExtraSpacing:
612
+ Description: 'Do not use unnecessary spacing.'
613
+ Enabled: true
614
+ VersionAdded: '0.49'
615
+ # When true, allows most uses of extra spacing if the intent is to align
616
+ # things with the previous or next line, not counting empty lines or comment
617
+ # lines.
618
+ AllowForAlignment: true
619
+ # When true, allows things like 'obj.meth(arg) # comment',
620
+ # rather than insisting on 'obj.meth(arg) # comment'.
621
+ # If done for alignment, either this OR AllowForAlignment will allow it.
622
+ AllowBeforeTrailingComments: false
623
+ # When true, forces the alignment of `=` in assignments on consecutive lines.
624
+ ForceEqualSignAlignment: false
625
+
626
+ Layout/FirstArgumentIndentation:
627
+ Description: 'Checks the indentation of the first argument in a method call.'
628
+ Enabled: true
629
+ VersionAdded: '0.68'
630
+ VersionChanged: '0.77'
631
+ EnforcedStyle: special_for_inner_method_call_in_parentheses
632
+ SupportedStyles:
633
+ # The first parameter should always be indented one step more than the
634
+ # preceding line.
635
+ - consistent
636
+ # The first parameter should always be indented one level relative to the
637
+ # parent that is receiving the parameter
638
+ - consistent_relative_to_receiver
639
+ # The first parameter should normally be indented one step more than the
640
+ # preceding line, but if it's a parameter for a method call that is itself
641
+ # a parameter in a method call, then the inner parameter should be indented
642
+ # relative to the inner method.
643
+ - special_for_inner_method_call
644
+ # Same as `special_for_inner_method_call` except that the special rule only
645
+ # applies if the outer method call encloses its arguments in parentheses.
646
+ - special_for_inner_method_call_in_parentheses
647
+ # By default, the indentation width from `Layout/IndentationWidth` is used
648
+ # But it can be overridden by setting this parameter
649
+ IndentationWidth: ~
650
+
651
+ Layout/FirstArrayElementIndentation:
652
+ Description: >-
653
+ Checks the indentation of the first element in an array
654
+ literal.
655
+ Enabled: true
656
+ VersionAdded: '0.68'
657
+ VersionChanged: '0.77'
658
+ # The value `special_inside_parentheses` means that array literals with
659
+ # brackets that have their opening bracket on the same line as a surrounding
660
+ # opening round parenthesis, shall have their first element indented relative
661
+ # to the first position inside the parenthesis.
662
+ #
663
+ # The value `consistent` means that the indentation of the first element shall
664
+ # always be relative to the first position of the line where the opening
665
+ # bracket is.
666
+ #
667
+ # The value `align_brackets` means that the indentation of the first element
668
+ # shall always be relative to the position of the opening bracket.
669
+ EnforcedStyle: special_inside_parentheses
670
+ SupportedStyles:
671
+ - special_inside_parentheses
672
+ - consistent
673
+ - align_brackets
674
+ # By default, the indentation width from `Layout/IndentationWidth` is used
675
+ # But it can be overridden by setting this parameter
676
+ IndentationWidth: ~
677
+
678
+ Layout/FirstArrayElementLineBreak:
679
+ Description: >-
680
+ Checks for a line break before the first element in a
681
+ multi-line array.
682
+ Enabled: false
683
+ VersionAdded: '0.49'
684
+
685
+ Layout/FirstHashElementIndentation:
686
+ Description: 'Checks the indentation of the first key in a hash literal.'
687
+ Enabled: true
688
+ VersionAdded: '0.68'
689
+ VersionChanged: '0.77'
690
+ # The value `special_inside_parentheses` means that hash literals with braces
691
+ # that have their opening brace on the same line as a surrounding opening
692
+ # round parenthesis, shall have their first key indented relative to the
693
+ # first position inside the parenthesis.
694
+ #
695
+ # The value `consistent` means that the indentation of the first key shall
696
+ # always be relative to the first position of the line where the opening
697
+ # brace is.
698
+ #
699
+ # The value `align_braces` means that the indentation of the first key shall
700
+ # always be relative to the position of the opening brace.
701
+ EnforcedStyle: special_inside_parentheses
702
+ SupportedStyles:
703
+ - special_inside_parentheses
704
+ - consistent
705
+ - align_braces
706
+ # By default, the indentation width from `Layout/IndentationWidth` is used
707
+ # But it can be overridden by setting this parameter
708
+ IndentationWidth: ~
709
+
710
+ Layout/FirstHashElementLineBreak:
711
+ Description: >-
712
+ Checks for a line break before the first element in a
713
+ multi-line hash.
714
+ Enabled: false
715
+ VersionAdded: '0.49'
716
+
717
+ Layout/FirstMethodArgumentLineBreak:
718
+ Description: >-
719
+ Checks for a line break before the first argument in a
720
+ multi-line method call.
721
+ Enabled: false
722
+ VersionAdded: '0.49'
723
+
724
+ Layout/FirstMethodParameterLineBreak:
725
+ Description: >-
726
+ Checks for a line break before the first parameter in a
727
+ multi-line method parameter definition.
728
+ Enabled: false
729
+ VersionAdded: '0.49'
730
+
731
+ Layout/FirstParameterIndentation:
732
+ Description: >-
733
+ Checks the indentation of the first parameter in a
734
+ method definition.
735
+ Enabled: true
736
+ VersionAdded: '0.49'
737
+ VersionChanged: '0.77'
738
+ EnforcedStyle: consistent
739
+ SupportedStyles:
740
+ - consistent
741
+ - align_parentheses
742
+ # By default, the indentation width from `Layout/IndentationWidth` is used
743
+ # But it can be overridden by setting this parameter
744
+ IndentationWidth: ~
745
+
746
+ Layout/HashAlignment:
747
+ Description: >-
748
+ Align the elements of a hash literal if they span more than
749
+ one line.
750
+ Enabled: true
751
+ AllowMultipleStyles: true
752
+ VersionAdded: '0.49'
753
+ VersionChanged: '0.77'
754
+ # Alignment of entries using hash rocket as separator. Valid values are:
755
+ #
756
+ # key - left alignment of keys
757
+ # 'a' => 2
758
+ # 'bb' => 3
759
+ # separator - alignment of hash rockets, keys are right aligned
760
+ # 'a' => 2
761
+ # 'bb' => 3
762
+ # table - left alignment of keys, hash rockets, and values
763
+ # 'a' => 2
764
+ # 'bb' => 3
765
+ EnforcedHashRocketStyle: key
766
+ SupportedHashRocketStyles:
767
+ - key
768
+ - separator
769
+ - table
770
+ # Alignment of entries using colon as separator. Valid values are:
771
+ #
772
+ # key - left alignment of keys
773
+ # a: 0
774
+ # bb: 1
775
+ # separator - alignment of colons, keys are right aligned
776
+ # a: 0
777
+ # bb: 1
778
+ # table - left alignment of keys and values
779
+ # a: 0
780
+ # bb: 1
781
+ EnforcedColonStyle: key
782
+ SupportedColonStyles:
783
+ - key
784
+ - separator
785
+ - table
786
+ # Select whether hashes that are the last argument in a method call should be
787
+ # inspected? Valid values are:
788
+ #
789
+ # always_inspect - Inspect both implicit and explicit hashes.
790
+ # Registers an offense for:
791
+ # function(a: 1,
792
+ # b: 2)
793
+ # Registers an offense for:
794
+ # function({a: 1,
795
+ # b: 2})
796
+ # always_ignore - Ignore both implicit and explicit hashes.
797
+ # Accepts:
798
+ # function(a: 1,
799
+ # b: 2)
800
+ # Accepts:
801
+ # function({a: 1,
802
+ # b: 2})
803
+ # ignore_implicit - Ignore only implicit hashes.
804
+ # Accepts:
805
+ # function(a: 1,
806
+ # b: 2)
807
+ # Registers an offense for:
808
+ # function({a: 1,
809
+ # b: 2})
810
+ # ignore_explicit - Ignore only explicit hashes.
811
+ # Accepts:
812
+ # function({a: 1,
813
+ # b: 2})
814
+ # Registers an offense for:
815
+ # function(a: 1,
816
+ # b: 2)
817
+ EnforcedLastArgumentHashStyle: always_inspect
818
+ SupportedLastArgumentHashStyles:
819
+ - always_inspect
820
+ - always_ignore
821
+ - ignore_implicit
822
+ - ignore_explicit
823
+
824
+ Layout/HeredocArgumentClosingParenthesis:
825
+ Description: >-
826
+ Checks for the placement of the closing parenthesis in a
827
+ method call that passes a HEREDOC string as an argument.
828
+ Enabled: false
829
+ StyleGuide: '#heredoc-argument-closing-parentheses'
830
+ VersionAdded: '0.68'
831
+
832
+ Layout/HeredocIndentation:
833
+ Description: 'This cop checks the indentation of the here document bodies.'
834
+ StyleGuide: '#squiggly-heredocs'
835
+ Enabled: true
836
+ VersionAdded: '0.49'
837
+ VersionChanged: '0.85'
838
+
839
+ Layout/IndentationConsistency:
840
+ Description: 'Keep indentation straight.'
841
+ StyleGuide: '#spaces-indentation'
842
+ Enabled: true
843
+ VersionAdded: '0.49'
844
+ # The difference between `indented` and `normal` is that the `indented_internal_methods`
845
+ # style prescribes that in classes and modules the `protected` and `private`
846
+ # modifier keywords shall be indented the same as public methods and that
847
+ # protected and private members shall be indented one step more than the
848
+ # modifiers. Other than that, both styles mean that entities on the same
849
+ # logical depth shall have the same indentation.
850
+ EnforcedStyle: normal
851
+ SupportedStyles:
852
+ - normal
853
+ - indented_internal_methods
854
+ Reference:
855
+ # A reference to `EnforcedStyle: indented_internal_methods`.
856
+ - https://edgeguides.rubyonrails.org/contributing_to_ruby_on_rails.html#follow-the-coding-conventions
857
+
858
+ Layout/IndentationStyle:
859
+ Description: 'Consistent indentation either with tabs only or spaces only.'
860
+ StyleGuide: '#spaces-indentation'
861
+ Enabled: true
862
+ VersionAdded: '0.49'
863
+ VersionChanged: '0.82'
864
+ # By default, the indentation width from Layout/IndentationWidth is used
865
+ # But it can be overridden by setting this parameter
866
+ # It is used during auto-correction to determine how many spaces should
867
+ # replace each tab.
868
+ IndentationWidth: ~
869
+ EnforcedStyle: spaces
870
+ SupportedStyles:
871
+ - spaces
872
+ - tabs
873
+
874
+ Layout/IndentationWidth:
875
+ Description: 'Use 2 spaces for indentation.'
876
+ StyleGuide: '#spaces-indentation'
877
+ Enabled: true
878
+ VersionAdded: '0.49'
879
+ # Number of spaces for each indentation level.
880
+ Width: 2
881
+ IgnoredPatterns: []
882
+
883
+ Layout/InitialIndentation:
884
+ Description: >-
885
+ Checks the indentation of the first non-blank non-comment line in a file.
886
+ Enabled: true
887
+ VersionAdded: '0.49'
888
+
889
+ Layout/LeadingCommentSpace:
890
+ Description: 'Comments should start with a space.'
891
+ StyleGuide: '#hash-space'
892
+ Enabled: true
893
+ VersionAdded: '0.49'
894
+ VersionChanged: '0.73'
895
+ AllowDoxygenCommentStyle: false
896
+ AllowGemfileRubyComment: false
897
+
898
+ Layout/LeadingEmptyLines:
899
+ Description: Check for unnecessary blank lines at the beginning of a file.
900
+ Enabled: true
901
+ VersionAdded: '0.57'
902
+ VersionChanged: '0.77'
903
+
904
+ Layout/LineLength:
905
+ Description: 'Checks that line length does not exceed the configured limit.'
906
+ StyleGuide: '#max-line-length'
907
+ Enabled: true
908
+ VersionAdded: '0.25'
909
+ VersionChanged: '1.4'
910
+ AutoCorrect: true
911
+ Max: 120
912
+ # To make it possible to copy or click on URIs in the code, we allow lines
913
+ # containing a URI to be longer than Max.
914
+ AllowHeredoc: true
915
+ AllowURI: true
916
+ URISchemes:
917
+ - http
918
+ - https
919
+ # The IgnoreCopDirectives option causes the LineLength rule to ignore cop
920
+ # directives like '# rubocop: enable ...' when calculating a line's length.
921
+ IgnoreCopDirectives: true
922
+ # The IgnoredPatterns option is a list of !ruby/regexp and/or string
923
+ # elements. Strings will be converted to Regexp objects. A line that matches
924
+ # any regular expression listed in this option will be ignored by LineLength.
925
+ IgnoredPatterns: []
926
+
927
+ Layout/MultilineArrayBraceLayout:
928
+ Description: >-
929
+ Checks that the closing brace in an array literal is
930
+ either on the same line as the last array element, or
931
+ a new line.
932
+ Enabled: true
933
+ VersionAdded: '0.49'
934
+ EnforcedStyle: symmetrical
935
+ SupportedStyles:
936
+ # symmetrical: closing brace is positioned in same way as opening brace
937
+ # new_line: closing brace is always on a new line
938
+ # same_line: closing brace is always on the same line as last element
939
+ - symmetrical
940
+ - new_line
941
+ - same_line
942
+
943
+ Layout/MultilineArrayLineBreaks:
944
+ Description: >-
945
+ Checks that each item in a multi-line array literal
946
+ starts on a separate line.
947
+ Enabled: false
948
+ VersionAdded: '0.67'
949
+
950
+ Layout/MultilineAssignmentLayout:
951
+ Description: 'Check for a newline after the assignment operator in multi-line assignments.'
952
+ StyleGuide: '#indent-conditional-assignment'
953
+ Enabled: false
954
+ VersionAdded: '0.49'
955
+ # The types of assignments which are subject to this rule.
956
+ SupportedTypes:
957
+ - block
958
+ - case
959
+ - class
960
+ - if
961
+ - kwbegin
962
+ - module
963
+ EnforcedStyle: new_line
964
+ SupportedStyles:
965
+ # Ensures that the assignment operator and the rhs are on the same line for
966
+ # the set of supported types.
967
+ - same_line
968
+ # Ensures that the assignment operator and the rhs are on separate lines
969
+ # for the set of supported types.
970
+ - new_line
971
+
972
+ Layout/MultilineBlockLayout:
973
+ Description: 'Ensures newlines after multiline block do statements.'
974
+ Enabled: true
975
+ VersionAdded: '0.49'
976
+
977
+ Layout/MultilineHashBraceLayout:
978
+ Description: >-
979
+ Checks that the closing brace in a hash literal is
980
+ either on the same line as the last hash element, or
981
+ a new line.
982
+ Enabled: true
983
+ VersionAdded: '0.49'
984
+ EnforcedStyle: symmetrical
985
+ SupportedStyles:
986
+ # symmetrical: closing brace is positioned in same way as opening brace
987
+ # new_line: closing brace is always on a new line
988
+ # same_line: closing brace is always on same line as last element
989
+ - symmetrical
990
+ - new_line
991
+ - same_line
992
+
993
+ Layout/MultilineHashKeyLineBreaks:
994
+ Description: >-
995
+ Checks that each item in a multi-line hash literal
996
+ starts on a separate line.
997
+ Enabled: false
998
+ VersionAdded: '0.67'
999
+
1000
+ Layout/MultilineMethodArgumentLineBreaks:
1001
+ Description: >-
1002
+ Checks that each argument in a multi-line method call
1003
+ starts on a separate line.
1004
+ Enabled: false
1005
+ VersionAdded: '0.67'
1006
+
1007
+ Layout/MultilineMethodCallBraceLayout:
1008
+ Description: >-
1009
+ Checks that the closing brace in a method call is
1010
+ either on the same line as the last method argument, or
1011
+ a new line.
1012
+ Enabled: true
1013
+ VersionAdded: '0.49'
1014
+ EnforcedStyle: symmetrical
1015
+ SupportedStyles:
1016
+ # symmetrical: closing brace is positioned in same way as opening brace
1017
+ # new_line: closing brace is always on a new line
1018
+ # same_line: closing brace is always on the same line as last argument
1019
+ - symmetrical
1020
+ - new_line
1021
+ - same_line
1022
+
1023
+ Layout/MultilineMethodCallIndentation:
1024
+ Description: >-
1025
+ Checks indentation of method calls with the dot operator
1026
+ that span more than one line.
1027
+ Enabled: true
1028
+ VersionAdded: '0.49'
1029
+ EnforcedStyle: aligned
1030
+ SupportedStyles:
1031
+ - aligned
1032
+ - indented
1033
+ - indented_relative_to_receiver
1034
+ # By default, the indentation width from Layout/IndentationWidth is used
1035
+ # But it can be overridden by setting this parameter
1036
+ IndentationWidth: ~
1037
+
1038
+ Layout/MultilineMethodDefinitionBraceLayout:
1039
+ Description: >-
1040
+ Checks that the closing brace in a method definition is
1041
+ either on the same line as the last method parameter, or
1042
+ a new line.
1043
+ Enabled: true
1044
+ VersionAdded: '0.49'
1045
+ EnforcedStyle: symmetrical
1046
+ SupportedStyles:
1047
+ # symmetrical: closing brace is positioned in same way as opening brace
1048
+ # new_line: closing brace is always on a new line
1049
+ # same_line: closing brace is always on the same line as last parameter
1050
+ - symmetrical
1051
+ - new_line
1052
+ - same_line
1053
+
1054
+ Layout/MultilineOperationIndentation:
1055
+ Description: >-
1056
+ Checks indentation of binary operations that span more than
1057
+ one line.
1058
+ Enabled: true
1059
+ VersionAdded: '0.49'
1060
+ EnforcedStyle: aligned
1061
+ SupportedStyles:
1062
+ - aligned
1063
+ - indented
1064
+ # By default, the indentation width from `Layout/IndentationWidth` is used
1065
+ # But it can be overridden by setting this parameter
1066
+ IndentationWidth: ~
1067
+
1068
+ Layout/ParameterAlignment:
1069
+ Description: >-
1070
+ Align the parameters of a method definition if they span more
1071
+ than one line.
1072
+ StyleGuide: '#no-double-indent'
1073
+ Enabled: true
1074
+ VersionAdded: '0.49'
1075
+ VersionChanged: '0.77'
1076
+ # Alignment of parameters in multi-line method calls.
1077
+ #
1078
+ # The `with_first_parameter` style aligns the following lines along the same
1079
+ # column as the first parameter.
1080
+ #
1081
+ # def method_foo(a,
1082
+ # b)
1083
+ #
1084
+ # The `with_fixed_indentation` style aligns the following lines with one
1085
+ # level of indentation relative to the start of the line with the method call.
1086
+ #
1087
+ # def method_foo(a,
1088
+ # b)
1089
+ EnforcedStyle: with_first_parameter
1090
+ SupportedStyles:
1091
+ - with_first_parameter
1092
+ - with_fixed_indentation
1093
+ # By default, the indentation width from Layout/IndentationWidth is used
1094
+ # But it can be overridden by setting this parameter
1095
+ IndentationWidth: ~
1096
+
1097
+ Layout/RescueEnsureAlignment:
1098
+ Description: 'Align rescues and ensures correctly.'
1099
+ Enabled: true
1100
+ VersionAdded: '0.49'
1101
+
1102
+ Layout/SpaceAfterColon:
1103
+ Description: 'Use spaces after colons.'
1104
+ StyleGuide: '#spaces-operators'
1105
+ Enabled: true
1106
+ VersionAdded: '0.49'
1107
+
1108
+ Layout/SpaceAfterComma:
1109
+ Description: 'Use spaces after commas.'
1110
+ StyleGuide: '#spaces-operators'
1111
+ Enabled: true
1112
+ VersionAdded: '0.49'
1113
+
1114
+ Layout/SpaceAfterMethodName:
1115
+ Description: >-
1116
+ Do not put a space between a method name and the opening
1117
+ parenthesis in a method definition.
1118
+ StyleGuide: '#parens-no-spaces'
1119
+ Enabled: true
1120
+ VersionAdded: '0.49'
1121
+
1122
+ Layout/SpaceAfterNot:
1123
+ Description: Tracks redundant space after the ! operator.
1124
+ StyleGuide: '#no-space-bang'
1125
+ Enabled: true
1126
+ VersionAdded: '0.49'
1127
+
1128
+ Layout/SpaceAfterSemicolon:
1129
+ Description: 'Use spaces after semicolons.'
1130
+ StyleGuide: '#spaces-operators'
1131
+ Enabled: true
1132
+ VersionAdded: '0.49'
1133
+
1134
+ Layout/SpaceAroundBlockParameters:
1135
+ Description: 'Checks the spacing inside and after block parameters pipes.'
1136
+ Enabled: true
1137
+ VersionAdded: '0.49'
1138
+ EnforcedStyleInsidePipes: no_space
1139
+ SupportedStylesInsidePipes:
1140
+ - space
1141
+ - no_space
1142
+
1143
+ Layout/SpaceAroundEqualsInParameterDefault:
1144
+ Description: >-
1145
+ Checks that the equals signs in parameter default assignments
1146
+ have or don't have surrounding space depending on
1147
+ configuration.
1148
+ StyleGuide: '#spaces-around-equals'
1149
+ Enabled: true
1150
+ VersionAdded: '0.49'
1151
+ EnforcedStyle: space
1152
+ SupportedStyles:
1153
+ - space
1154
+ - no_space
1155
+
1156
+ Layout/SpaceAroundKeyword:
1157
+ Description: 'Use a space around keywords if appropriate.'
1158
+ Enabled: true
1159
+ VersionAdded: '0.49'
1160
+
1161
+ Layout/SpaceAroundMethodCallOperator:
1162
+ Description: 'Checks method call operators to not have spaces around them.'
1163
+ Enabled: true
1164
+ VersionAdded: '0.82'
1165
+
1166
+ Layout/SpaceAroundOperators:
1167
+ Description: 'Use a single space around operators.'
1168
+ StyleGuide: '#spaces-operators'
1169
+ Enabled: true
1170
+ VersionAdded: '0.49'
1171
+ # When `true`, allows most uses of extra spacing if the intent is to align
1172
+ # with an operator on the previous or next line, not counting empty lines
1173
+ # or comment lines.
1174
+ AllowForAlignment: true
1175
+ EnforcedStyleForExponentOperator: no_space
1176
+ SupportedStylesForExponentOperator:
1177
+ - space
1178
+ - no_space
1179
+
1180
+ Layout/SpaceBeforeBlockBraces:
1181
+ Description: >-
1182
+ Checks that the left block brace has or doesn't have space
1183
+ before it.
1184
+ Enabled: true
1185
+ VersionAdded: '0.49'
1186
+ EnforcedStyle: space
1187
+ SupportedStyles:
1188
+ - space
1189
+ - no_space
1190
+ EnforcedStyleForEmptyBraces: space
1191
+ SupportedStylesForEmptyBraces:
1192
+ - space
1193
+ - no_space
1194
+ VersionChanged: '0.52'
1195
+
1196
+ Layout/SpaceBeforeBrackets:
1197
+ Description: 'Checks for receiver with a space before the opening brackets.'
1198
+ StyleGuide: '#space-in-brackets-access'
1199
+ Enabled: pending
1200
+ VersionAdded: '1.7'
1201
+
1202
+ Layout/SpaceBeforeComma:
1203
+ Description: 'No spaces before commas.'
1204
+ Enabled: true
1205
+ VersionAdded: '0.49'
1206
+
1207
+ Layout/SpaceBeforeComment:
1208
+ Description: >-
1209
+ Checks for missing space between code and a comment on the
1210
+ same line.
1211
+ Enabled: true
1212
+ VersionAdded: '0.49'
1213
+
1214
+ Layout/SpaceBeforeFirstArg:
1215
+ Description: >-
1216
+ Checks that exactly one space is used between a method name
1217
+ and the first argument for method calls without parentheses.
1218
+ Enabled: true
1219
+ VersionAdded: '0.49'
1220
+ # When `true`, allows most uses of extra spacing if the intent is to align
1221
+ # things with the previous or next line, not counting empty lines or comment
1222
+ # lines.
1223
+ AllowForAlignment: true
1224
+
1225
+ Layout/SpaceBeforeSemicolon:
1226
+ Description: 'No spaces before semicolons.'
1227
+ Enabled: true
1228
+ VersionAdded: '0.49'
1229
+
1230
+ Layout/SpaceInLambdaLiteral:
1231
+ Description: 'Checks for spaces in lambda literals.'
1232
+ Enabled: true
1233
+ VersionAdded: '0.49'
1234
+ EnforcedStyle: require_no_space
1235
+ SupportedStyles:
1236
+ - require_no_space
1237
+ - require_space
1238
+
1239
+ Layout/SpaceInsideArrayLiteralBrackets:
1240
+ Description: 'Checks the spacing inside array literal brackets.'
1241
+ Enabled: true
1242
+ VersionAdded: '0.52'
1243
+ EnforcedStyle: no_space
1244
+ SupportedStyles:
1245
+ - space
1246
+ - no_space
1247
+ # 'compact' normally requires a space inside the brackets, with the exception
1248
+ # that successive left brackets or right brackets are collapsed together
1249
+ - compact
1250
+ EnforcedStyleForEmptyBrackets: no_space
1251
+ SupportedStylesForEmptyBrackets:
1252
+ - space
1253
+ - no_space
1254
+
1255
+ Layout/SpaceInsideArrayPercentLiteral:
1256
+ Description: 'No unnecessary additional spaces between elements in %i/%w literals.'
1257
+ Enabled: true
1258
+ VersionAdded: '0.49'
1259
+
1260
+ Layout/SpaceInsideBlockBraces:
1261
+ Description: >-
1262
+ Checks that block braces have or don't have surrounding space.
1263
+ For blocks taking parameters, checks that the left brace has
1264
+ or doesn't have trailing space.
1265
+ Enabled: true
1266
+ VersionAdded: '0.49'
1267
+ EnforcedStyle: space
1268
+ SupportedStyles:
1269
+ - space
1270
+ - no_space
1271
+ EnforcedStyleForEmptyBraces: no_space
1272
+ SupportedStylesForEmptyBraces:
1273
+ - space
1274
+ - no_space
1275
+ # Space between `{` and `|`. Overrides `EnforcedStyle` if there is a conflict.
1276
+ SpaceBeforeBlockParameters: true
1277
+
1278
+ Layout/SpaceInsideHashLiteralBraces:
1279
+ Description: "Use spaces inside hash literal braces - or don't."
1280
+ StyleGuide: '#spaces-braces'
1281
+ Enabled: true
1282
+ VersionAdded: '0.49'
1283
+ EnforcedStyle: space
1284
+ SupportedStyles:
1285
+ - space
1286
+ - no_space
1287
+ # 'compact' normally requires a space inside hash braces, with the exception
1288
+ # that successive left braces or right braces are collapsed together
1289
+ - compact
1290
+ EnforcedStyleForEmptyBraces: no_space
1291
+ SupportedStylesForEmptyBraces:
1292
+ - space
1293
+ - no_space
1294
+
1295
+
1296
+ Layout/SpaceInsideParens:
1297
+ Description: 'No spaces after ( or before ).'
1298
+ StyleGuide: '#spaces-braces'
1299
+ Enabled: true
1300
+ VersionAdded: '0.49'
1301
+ VersionChanged: '0.55'
1302
+ EnforcedStyle: no_space
1303
+ SupportedStyles:
1304
+ - space
1305
+ - no_space
1306
+
1307
+ Layout/SpaceInsidePercentLiteralDelimiters:
1308
+ Description: 'No unnecessary spaces inside delimiters of %i/%w/%x literals.'
1309
+ Enabled: true
1310
+ VersionAdded: '0.49'
1311
+
1312
+ Layout/SpaceInsideRangeLiteral:
1313
+ Description: 'No spaces inside range literals.'
1314
+ StyleGuide: '#no-space-inside-range-literals'
1315
+ Enabled: true
1316
+ VersionAdded: '0.49'
1317
+
1318
+ Layout/SpaceInsideReferenceBrackets:
1319
+ Description: 'Checks the spacing inside referential brackets.'
1320
+ Enabled: true
1321
+ VersionAdded: '0.52'
1322
+ VersionChanged: '0.53'
1323
+ EnforcedStyle: no_space
1324
+ SupportedStyles:
1325
+ - space
1326
+ - no_space
1327
+ EnforcedStyleForEmptyBrackets: no_space
1328
+ SupportedStylesForEmptyBrackets:
1329
+ - space
1330
+ - no_space
1331
+
1332
+ Layout/SpaceInsideStringInterpolation:
1333
+ Description: 'Checks for padding/surrounding spaces inside string interpolation.'
1334
+ StyleGuide: '#string-interpolation'
1335
+ Enabled: true
1336
+ VersionAdded: '0.49'
1337
+ EnforcedStyle: no_space
1338
+ SupportedStyles:
1339
+ - space
1340
+ - no_space
1341
+
1342
+ Layout/TrailingEmptyLines:
1343
+ Description: 'Checks trailing blank lines and final newline.'
1344
+ StyleGuide: '#newline-eof'
1345
+ Enabled: true
1346
+ VersionAdded: '0.49'
1347
+ VersionChanged: '0.77'
1348
+ EnforcedStyle: final_newline
1349
+ SupportedStyles:
1350
+ - final_newline
1351
+ - final_blank_line
1352
+
1353
+ Layout/TrailingWhitespace:
1354
+ Description: 'Avoid trailing whitespace.'
1355
+ StyleGuide: '#no-trailing-whitespace'
1356
+ Enabled: true
1357
+ VersionAdded: '0.49'
1358
+ VersionChanged: '1.0'
1359
+ AllowInHeredoc: false
1360
+
1361
+ #################### Lint ##################################
1362
+ ### Warnings
1363
+
1364
+ Lint/AmbiguousAssignment:
1365
+ Description: 'Checks for mistyped shorthand assignments.'
1366
+ Enabled: pending
1367
+ VersionAdded: '1.7'
1368
+
1369
+ Lint/AmbiguousBlockAssociation:
1370
+ Description: >-
1371
+ Checks for ambiguous block association with method when param passed without
1372
+ parentheses.
1373
+ StyleGuide: '#syntax'
1374
+ Enabled: true
1375
+ VersionAdded: '0.48'
1376
+
1377
+ Lint/AmbiguousOperator:
1378
+ Description: >-
1379
+ Checks for ambiguous operators in the first argument of a
1380
+ method invocation without parentheses.
1381
+ StyleGuide: '#method-invocation-parens'
1382
+ Enabled: true
1383
+ VersionAdded: '0.17'
1384
+ VersionChanged: '0.83'
1385
+
1386
+ Lint/AmbiguousRegexpLiteral:
1387
+ Description: >-
1388
+ Checks for ambiguous regexp literals in the first argument of
1389
+ a method invocation without parentheses.
1390
+ Enabled: true
1391
+ VersionAdded: '0.17'
1392
+ VersionChanged: '0.83'
1393
+
1394
+ Lint/AssignmentInCondition:
1395
+ Description: "Don't use assignment in conditions."
1396
+ StyleGuide: '#safe-assignment-in-condition'
1397
+ Enabled: true
1398
+ VersionAdded: '0.9'
1399
+ AllowSafeAssignment: true
1400
+
1401
+ Lint/BigDecimalNew:
1402
+ Description: '`BigDecimal.new()` is deprecated. Use `BigDecimal()` instead.'
1403
+ Enabled: true
1404
+ VersionAdded: '0.53'
1405
+
1406
+ Lint/BinaryOperatorWithIdenticalOperands:
1407
+ Description: 'This cop checks for places where binary operator has identical operands.'
1408
+ Enabled: true
1409
+ Safe: false
1410
+ VersionAdded: '0.89'
1411
+ VersionChanged: '1.7'
1412
+
1413
+ Lint/BooleanSymbol:
1414
+ Description: 'Check for `:true` and `:false` symbols.'
1415
+ Enabled: true
1416
+ Safe: false
1417
+ VersionAdded: '0.50'
1418
+ VersionChanged: '0.83'
1419
+
1420
+ Lint/CircularArgumentReference:
1421
+ Description: "Default values in optional keyword arguments and optional ordinal arguments should not refer back to the name of the argument."
1422
+ Enabled: true
1423
+ VersionAdded: '0.33'
1424
+
1425
+ Lint/ConstantDefinitionInBlock:
1426
+ Description: 'Do not define constants within a block.'
1427
+ StyleGuide: '#no-constant-definition-in-block'
1428
+ Enabled: true
1429
+ VersionAdded: '0.91'
1430
+ VersionChanged: '1.3'
1431
+ # `enums` for Typed Enums via T::Enum in Sorbet.
1432
+ # https://sorbet.org/docs/tenum
1433
+ AllowedMethods:
1434
+ - enums
1435
+
1436
+ Lint/ConstantResolution:
1437
+ Description: 'Check that constants are fully qualified with `::`.'
1438
+ Enabled: false
1439
+ VersionAdded: '0.86'
1440
+ # Restrict this cop to only looking at certain names
1441
+ Only: []
1442
+ # Restrict this cop from only looking at certain names
1443
+ Ignore: []
1444
+
1445
+ Lint/Debugger:
1446
+ Description: 'Check for debugger calls.'
1447
+ Enabled: true
1448
+ VersionAdded: '0.14'
1449
+ VersionChanged: '0.49'
1450
+ DebuggerReceivers:
1451
+ - binding
1452
+ - Kernel
1453
+ - Pry
1454
+ DebuggerMethods:
1455
+ - debugger
1456
+ - byebug
1457
+ - remote_byebug
1458
+ - pry
1459
+ - remote_pry
1460
+ - pry_remote
1461
+ - console
1462
+ - rescue
1463
+ - save_and_open_page
1464
+ - save_and_open_screenshot
1465
+ - irb
1466
+
1467
+ Lint/DeprecatedClassMethods:
1468
+ Description: 'Check for deprecated class method calls.'
1469
+ Enabled: true
1470
+ VersionAdded: '0.19'
1471
+
1472
+ Lint/DeprecatedConstants:
1473
+ Description: 'Checks for deprecated constants.'
1474
+ Enabled: pending
1475
+ VersionAdded: '1.8'
1476
+ # You can configure deprecated constants.
1477
+ # If there is an alternative method, you can set alternative value as `Alternative`.
1478
+ # And you can set the deprecated version as `DeprecatedVersion`.
1479
+ # These options can be omitted if they are not needed.
1480
+ #
1481
+ # DeprecatedConstants:
1482
+ # 'DEPRECATED_CONSTANT':
1483
+ # Alternative: 'alternative_value'
1484
+ # DeprecatedVersion: 'deprecated_version'
1485
+ #
1486
+ DeprecatedConstants:
1487
+ 'NIL':
1488
+ Alternative: 'nil'
1489
+ DeprecatedVersion: '2.4'
1490
+ 'TRUE':
1491
+ Alternative: 'true'
1492
+ DeprecatedVersion: '2.4'
1493
+ 'FALSE':
1494
+ Alternative: 'false'
1495
+ DeprecatedVersion: '2.4'
1496
+ 'Random::DEFAULT':
1497
+ Alternative: 'Random.new'
1498
+ DeprecatedVersion: '3.0'
1499
+
1500
+ Lint/DeprecatedOpenSSLConstant:
1501
+ Description: "Don't use algorithm constants for `OpenSSL::Cipher` and `OpenSSL::Digest`."
1502
+ Enabled: true
1503
+ VersionAdded: '0.84'
1504
+
1505
+ Lint/DisjunctiveAssignmentInConstructor:
1506
+ Description: 'In constructor, plain assignment is preferred over disjunctive.'
1507
+ Enabled: true
1508
+ Safe: false
1509
+ VersionAdded: '0.62'
1510
+ VersionChanged: '0.88'
1511
+
1512
+ Lint/DuplicateBranch:
1513
+ Description: Checks that there are no repeated bodies within `if/unless`, `case-when` and `rescue` constructs.
1514
+ Enabled: pending
1515
+ VersionAdded: '1.3'
1516
+ VersionChanged: '1.7'
1517
+ IgnoreLiteralBranches: false
1518
+ IgnoreConstantBranches: false
1519
+
1520
+ Lint/DuplicateCaseCondition:
1521
+ Description: 'Do not repeat values in case conditionals.'
1522
+ Enabled: true
1523
+ VersionAdded: '0.45'
1524
+
1525
+ Lint/DuplicateElsifCondition:
1526
+ Description: 'Do not repeat conditions used in if `elsif`.'
1527
+ Enabled: true
1528
+ VersionAdded: '0.88'
1529
+
1530
+ Lint/DuplicateHashKey:
1531
+ Description: 'Check for duplicate keys in hash literals.'
1532
+ Enabled: true
1533
+ VersionAdded: '0.34'
1534
+ VersionChanged: '0.77'
1535
+
1536
+ Lint/DuplicateMethods:
1537
+ Description: 'Check for duplicate method definitions.'
1538
+ Enabled: true
1539
+ VersionAdded: '0.29'
1540
+
1541
+ Lint/DuplicateRegexpCharacterClassElement:
1542
+ Description: 'Checks for duplicate elements in Regexp character classes.'
1543
+ Enabled: pending
1544
+ VersionAdded: '1.1'
1545
+
1546
+ Lint/DuplicateRequire:
1547
+ Description: 'Check for duplicate `require`s and `require_relative`s.'
1548
+ Enabled: true
1549
+ VersionAdded: '0.90'
1550
+
1551
+ Lint/DuplicateRescueException:
1552
+ Description: 'Checks that there are no repeated exceptions used in `rescue` expressions.'
1553
+ Enabled: true
1554
+ VersionAdded: '0.89'
1555
+
1556
+ Lint/EachWithObjectArgument:
1557
+ Description: 'Check for immutable argument given to each_with_object.'
1558
+ Enabled: true
1559
+ VersionAdded: '0.31'
1560
+
1561
+ Lint/ElseLayout:
1562
+ Description: 'Check for odd code arrangement in an else block.'
1563
+ Enabled: true
1564
+ VersionAdded: '0.17'
1565
+ VersionChanged: '1.2'
1566
+
1567
+ Lint/EmptyBlock:
1568
+ Description: 'This cop checks for blocks without a body.'
1569
+ Enabled: pending
1570
+ VersionAdded: '1.1'
1571
+ VersionChanged: '1.3'
1572
+ AllowComments: true
1573
+ AllowEmptyLambdas: true
1574
+
1575
+ Lint/EmptyClass:
1576
+ Description: 'Checks for classes and metaclasses without a body.'
1577
+ Enabled: pending
1578
+ VersionAdded: '1.3'
1579
+ AllowComments: false
1580
+
1581
+ Lint/EmptyConditionalBody:
1582
+ Description: 'This cop checks for the presence of `if`, `elsif` and `unless` branches without a body.'
1583
+ Enabled: true
1584
+ AllowComments: true
1585
+ VersionAdded: '0.89'
1586
+
1587
+ Lint/EmptyEnsure:
1588
+ Description: 'Checks for empty ensure block.'
1589
+ Enabled: true
1590
+ VersionAdded: '0.10'
1591
+ VersionChanged: '0.48'
1592
+
1593
+ Lint/EmptyExpression:
1594
+ Description: 'Checks for empty expressions.'
1595
+ Enabled: true
1596
+ VersionAdded: '0.45'
1597
+
1598
+ Lint/EmptyFile:
1599
+ Description: 'Enforces that Ruby source files are not empty.'
1600
+ Enabled: true
1601
+ AllowComments: true
1602
+ VersionAdded: '0.90'
1603
+
1604
+ Lint/EmptyInterpolation:
1605
+ Description: 'Checks for empty string interpolation.'
1606
+ Enabled: true
1607
+ VersionAdded: '0.20'
1608
+ VersionChanged: '0.45'
1609
+
1610
+ Lint/EmptyWhen:
1611
+ Description: 'Checks for `when` branches with empty bodies.'
1612
+ Enabled: true
1613
+ AllowComments: true
1614
+ VersionAdded: '0.45'
1615
+ VersionChanged: '0.83'
1616
+
1617
+ Lint/EnsureReturn:
1618
+ Description: 'Do not use return in an ensure block.'
1619
+ StyleGuide: '#no-return-ensure'
1620
+ Enabled: true
1621
+ VersionAdded: '0.9'
1622
+ VersionChanged: '0.83'
1623
+
1624
+ Lint/ErbNewArguments:
1625
+ Description: 'Use `:trim_mode` and `:eoutvar` keyword arguments to `ERB.new`.'
1626
+ Enabled: true
1627
+ VersionAdded: '0.56'
1628
+
1629
+ Lint/FlipFlop:
1630
+ Description: 'Checks for flip-flops.'
1631
+ StyleGuide: '#no-flip-flops'
1632
+ Enabled: true
1633
+ VersionAdded: '0.16'
1634
+
1635
+ Lint/FloatComparison:
1636
+ Description: 'Checks for the presence of precise comparison of floating point numbers.'
1637
+ StyleGuide: '#float-comparison'
1638
+ Enabled: true
1639
+ VersionAdded: '0.89'
1640
+
1641
+ Lint/FloatOutOfRange:
1642
+ Description: >-
1643
+ Catches floating-point literals too large or small for Ruby to
1644
+ represent.
1645
+ Enabled: true
1646
+ VersionAdded: '0.36'
1647
+
1648
+ Lint/FormatParameterMismatch:
1649
+ Description: 'The number of parameters to format/sprint must match the fields.'
1650
+ Enabled: true
1651
+ VersionAdded: '0.33'
1652
+
1653
+ Lint/HashCompareByIdentity:
1654
+ Description: 'Prefer using `Hash#compare_by_identity` than using `object_id` for keys.'
1655
+ StyleGuide: '#identity-comparison'
1656
+ Enabled: true
1657
+ Safe: false
1658
+ VersionAdded: '0.93'
1659
+
1660
+ Lint/HeredocMethodCallPosition:
1661
+ Description: >-
1662
+ Checks for the ordering of a method call where
1663
+ the receiver of the call is a HEREDOC.
1664
+ Enabled: false
1665
+ StyleGuide: '#heredoc-method-calls'
1666
+ VersionAdded: '0.68'
1667
+
1668
+ Lint/IdentityComparison:
1669
+ Description: 'Prefer `equal?` over `==` when comparing `object_id`.'
1670
+ Enabled: true
1671
+ StyleGuide: '#identity-comparison'
1672
+ VersionAdded: '0.91'
1673
+
1674
+ Lint/ImplicitStringConcatenation:
1675
+ Description: >-
1676
+ Checks for adjacent string literals on the same line, which
1677
+ could better be represented as a single string literal.
1678
+ Enabled: true
1679
+ VersionAdded: '0.36'
1680
+
1681
+ Lint/IneffectiveAccessModifier:
1682
+ Description: >-
1683
+ Checks for attempts to use `private` or `protected` to set
1684
+ the visibility of a class method, which does not work.
1685
+ Enabled: true
1686
+ VersionAdded: '0.36'
1687
+
1688
+ Lint/InheritException:
1689
+ Description: 'Avoid inheriting from the `Exception` class.'
1690
+ Enabled: true
1691
+ VersionAdded: '0.41'
1692
+ # The default base class in favour of `Exception`.
1693
+ EnforcedStyle: runtime_error
1694
+ SupportedStyles:
1695
+ - runtime_error
1696
+ - standard_error
1697
+
1698
+ Lint/InterpolationCheck:
1699
+ Description: 'Raise warning for interpolation in single q strs.'
1700
+ Enabled: true
1701
+ Safe: false
1702
+ VersionAdded: '0.50'
1703
+ VersionChanged: '0.87'
1704
+
1705
+ Lint/LambdaWithoutLiteralBlock:
1706
+ Description: 'Checks uses of lambda without a literal block.'
1707
+ Enabled: pending
1708
+ VersionAdded: '1.8'
1709
+
1710
+ Lint/LiteralAsCondition:
1711
+ Description: 'Checks of literals used in conditions.'
1712
+ Enabled: true
1713
+ VersionAdded: '0.51'
1714
+
1715
+ Lint/LiteralInInterpolation:
1716
+ Description: 'Checks for literals used in interpolation.'
1717
+ Enabled: true
1718
+ VersionAdded: '0.19'
1719
+ VersionChanged: '0.32'
1720
+
1721
+ Lint/Loop:
1722
+ Description: >-
1723
+ Use Kernel#loop with break rather than begin/end/until or
1724
+ begin/end/while for post-loop tests.
1725
+ StyleGuide: '#loop-with-break'
1726
+ Enabled: true
1727
+ VersionAdded: '0.9'
1728
+ VersionChanged: '1.3'
1729
+ Safe: false
1730
+
1731
+ Lint/MissingCopEnableDirective:
1732
+ Description: 'Checks for a `# rubocop:enable` after `# rubocop:disable`.'
1733
+ Enabled: true
1734
+ VersionAdded: '0.52'
1735
+ # Maximum number of consecutive lines the cop can be disabled for.
1736
+ # 0 allows only single-line disables
1737
+ # 1 would mean the maximum allowed is the following:
1738
+ # # rubocop:disable SomeCop
1739
+ # a = 1
1740
+ # # rubocop:enable SomeCop
1741
+ # .inf for any size
1742
+ MaximumRangeSize: .inf
1743
+
1744
+ Lint/MissingSuper:
1745
+ Description: >-
1746
+ This cop checks for the presence of constructors and lifecycle callbacks
1747
+ without calls to `super`'.
1748
+ Enabled: true
1749
+ VersionAdded: '0.89'
1750
+ VersionChanged: '1.4'
1751
+
1752
+ Lint/MixedRegexpCaptureTypes:
1753
+ Description: 'Do not mix named captures and numbered captures in a Regexp literal.'
1754
+ Enabled: true
1755
+ VersionAdded: '0.85'
1756
+
1757
+ Lint/MultipleComparison:
1758
+ Description: "Use `&&` operator to compare multiple values."
1759
+ Enabled: true
1760
+ VersionAdded: '0.47'
1761
+ VersionChanged: '1.1'
1762
+ AllowMethodComparison: true
1763
+
1764
+ Lint/NestedMethodDefinition:
1765
+ Description: 'Do not use nested method definitions.'
1766
+ StyleGuide: '#no-nested-methods'
1767
+ Enabled: true
1768
+ VersionAdded: '0.32'
1769
+
1770
+ Lint/NestedPercentLiteral:
1771
+ Description: 'Checks for nested percent literals.'
1772
+ Enabled: true
1773
+ VersionAdded: '0.52'
1774
+
1775
+ Lint/NextWithoutAccumulator:
1776
+ Description: >-
1777
+ Do not omit the accumulator when calling `next`
1778
+ in a `reduce`/`inject` block.
1779
+ Enabled: true
1780
+ VersionAdded: '0.36'
1781
+
1782
+ Lint/NoReturnInBeginEndBlocks:
1783
+ Description: 'Do not `return` inside `begin..end` blocks in assignment contexts.'
1784
+ Enabled: pending
1785
+ VersionAdded: '1.2'
1786
+
1787
+ Lint/NonDeterministicRequireOrder:
1788
+ Description: 'Always sort arrays returned by Dir.glob when requiring files.'
1789
+ Enabled: true
1790
+ VersionAdded: '0.78'
1791
+ Safe: false
1792
+
1793
+ Lint/NonLocalExitFromIterator:
1794
+ Description: 'Do not use return in iterator to cause non-local exit.'
1795
+ Enabled: true
1796
+ VersionAdded: '0.30'
1797
+
1798
+ Lint/NumberConversion:
1799
+ Description: 'Checks unsafe usage of number conversion methods.'
1800
+ Enabled: false
1801
+ VersionAdded: '0.53'
1802
+ VersionChanged: '1.1'
1803
+ SafeAutoCorrect: false
1804
+ IgnoredMethods: []
1805
+ IgnoredClasses:
1806
+ - Time
1807
+ - DateTime
1808
+
1809
+ Lint/NumberedParameterAssignment:
1810
+ Description: 'Checks for uses of numbered parameter assignment.'
1811
+ Enabled: pending
1812
+ VersionAdded: '1.9'
1813
+
1814
+ Lint/OrAssignmentToConstant:
1815
+ Description: 'Checks unintended or-assignment to constant.'
1816
+ Enabled: pending
1817
+ Safe: false
1818
+ VersionAdded: '1.9'
1819
+
1820
+ Lint/OrderedMagicComments:
1821
+ Description: 'Checks the proper ordering of magic comments and whether a magic comment is not placed before a shebang.'
1822
+ Enabled: true
1823
+ VersionAdded: '0.53'
1824
+
1825
+ Lint/OutOfRangeRegexpRef:
1826
+ Description: 'Checks for out of range reference for Regexp because it always returns nil.'
1827
+ Enabled: true
1828
+ Safe: false
1829
+ VersionAdded: '0.89'
1830
+
1831
+ Lint/ParenthesesAsGroupedExpression:
1832
+ Description: >-
1833
+ Checks for method calls with a space before the opening
1834
+ parenthesis.
1835
+ StyleGuide: '#parens-no-spaces'
1836
+ Enabled: true
1837
+ VersionAdded: '0.12'
1838
+ VersionChanged: '0.83'
1839
+
1840
+ Lint/PercentStringArray:
1841
+ Description: >-
1842
+ Checks for unwanted commas and quotes in %w/%W literals.
1843
+ Enabled: true
1844
+ Safe: false
1845
+ VersionAdded: '0.41'
1846
+
1847
+ Lint/PercentSymbolArray:
1848
+ Description: >-
1849
+ Checks for unwanted commas and colons in %i/%I literals.
1850
+ Enabled: true
1851
+ VersionAdded: '0.41'
1852
+
1853
+ Lint/RaiseException:
1854
+ Description: Checks for `raise` or `fail` statements which are raising `Exception` class.
1855
+ StyleGuide: '#raise-exception'
1856
+ Enabled: true
1857
+ Safe: false
1858
+ VersionAdded: '0.81'
1859
+ VersionChanged: '0.86'
1860
+ AllowedImplicitNamespaces:
1861
+ - 'Gem'
1862
+
1863
+ Lint/RandOne:
1864
+ Description: >-
1865
+ Checks for `rand(1)` calls. Such calls always return `0`
1866
+ and most likely a mistake.
1867
+ Enabled: true
1868
+ VersionAdded: '0.36'
1869
+
1870
+ Lint/RedundantCopDisableDirective:
1871
+ Description: >-
1872
+ Checks for rubocop:disable comments that can be removed.
1873
+ Note: this cop is not disabled when disabling all cops.
1874
+ It must be explicitly disabled.
1875
+ Enabled: true
1876
+ VersionAdded: '0.76'
1877
+
1878
+ Lint/RedundantCopEnableDirective:
1879
+ Description: Checks for rubocop:enable comments that can be removed.
1880
+ Enabled: true
1881
+ VersionAdded: '0.76'
1882
+
1883
+ Lint/RedundantDirGlobSort:
1884
+ Description: 'Checks for redundant `sort` method to `Dir.glob` and `Dir[]`.'
1885
+ Enabled: pending
1886
+ VersionAdded: '1.8'
1887
+
1888
+ Lint/RedundantRequireStatement:
1889
+ Description: 'Checks for unnecessary `require` statement.'
1890
+ Enabled: true
1891
+ VersionAdded: '0.76'
1892
+
1893
+ Lint/RedundantSafeNavigation:
1894
+ Description: 'Checks for redundant safe navigation calls.'
1895
+ Enabled: true
1896
+ VersionAdded: '0.93'
1897
+ AllowedMethods:
1898
+ - instance_of?
1899
+ - kind_of?
1900
+ - is_a?
1901
+ - eql?
1902
+ - respond_to?
1903
+ - equal?
1904
+ Safe: false
1905
+
1906
+ Lint/RedundantSplatExpansion:
1907
+ Description: 'Checks for splat unnecessarily being called on literals.'
1908
+ Enabled: true
1909
+ VersionAdded: '0.76'
1910
+ VersionChanged: '1.7'
1911
+ AllowPercentLiteralArrayArgument: true
1912
+
1913
+ Lint/RedundantStringCoercion:
1914
+ Description: 'Checks for Object#to_s usage in string interpolation.'
1915
+ StyleGuide: '#no-to-s'
1916
+ Enabled: true
1917
+ VersionAdded: '0.19'
1918
+ VersionChanged: '0.77'
1919
+
1920
+ Lint/RedundantWithIndex:
1921
+ Description: 'Checks for redundant `with_index`.'
1922
+ Enabled: true
1923
+ VersionAdded: '0.50'
1924
+
1925
+ Lint/RedundantWithObject:
1926
+ Description: 'Checks for redundant `with_object`.'
1927
+ Enabled: true
1928
+ VersionAdded: '0.51'
1929
+
1930
+ Lint/RegexpAsCondition:
1931
+ Description: >-
1932
+ Do not use regexp literal as a condition.
1933
+ The regexp literal matches `$_` implicitly.
1934
+ Enabled: true
1935
+ VersionAdded: '0.51'
1936
+ VersionChanged: '0.86'
1937
+
1938
+ Lint/RequireParentheses:
1939
+ Description: >-
1940
+ Use parentheses in the method call to avoid confusion
1941
+ about precedence.
1942
+ Enabled: true
1943
+ VersionAdded: '0.18'
1944
+
1945
+ Lint/RescueException:
1946
+ Description: 'Avoid rescuing the Exception class.'
1947
+ StyleGuide: '#no-blind-rescues'
1948
+ Enabled: true
1949
+ VersionAdded: '0.9'
1950
+ VersionChanged: '0.27'
1951
+
1952
+ Lint/RescueType:
1953
+ Description: 'Avoid rescuing from non constants that could result in a `TypeError`.'
1954
+ Enabled: true
1955
+ VersionAdded: '0.49'
1956
+
1957
+ Lint/ReturnInVoidContext:
1958
+ Description: 'Checks for return in void context.'
1959
+ Enabled: true
1960
+ VersionAdded: '0.50'
1961
+
1962
+ Lint/SafeNavigationChain:
1963
+ Description: 'Do not chain ordinary method call after safe navigation operator.'
1964
+ Enabled: true
1965
+ VersionAdded: '0.47'
1966
+ VersionChanged: '0.77'
1967
+ AllowedMethods:
1968
+ - present?
1969
+ - blank?
1970
+ - presence
1971
+ - try
1972
+ - try!
1973
+ - in?
1974
+
1975
+ Lint/SafeNavigationConsistency:
1976
+ Description: >-
1977
+ Check to make sure that if safe navigation is used for a method
1978
+ call in an `&&` or `||` condition that safe navigation is used
1979
+ for all method calls on that same object.
1980
+ Enabled: true
1981
+ VersionAdded: '0.55'
1982
+ VersionChanged: '0.77'
1983
+ AllowedMethods:
1984
+ - present?
1985
+ - blank?
1986
+ - presence
1987
+ - try
1988
+ - try!
1989
+
1990
+ Lint/SafeNavigationWithEmpty:
1991
+ Description: 'Avoid `foo&.empty?` in conditionals.'
1992
+ Enabled: true
1993
+ VersionAdded: '0.62'
1994
+ VersionChanged: '0.87'
1995
+
1996
+ Lint/ScriptPermission:
1997
+ Description: 'Grant script file execute permission.'
1998
+ Enabled: true
1999
+ VersionAdded: '0.49'
2000
+ VersionChanged: '0.50'
2001
+
2002
+ Lint/SelfAssignment:
2003
+ Description: 'Checks for self-assignments.'
2004
+ Enabled: true
2005
+ VersionAdded: '0.89'
2006
+
2007
+ Lint/SendWithMixinArgument:
2008
+ Description: 'Checks for `send` method when using mixin.'
2009
+ Enabled: true
2010
+ VersionAdded: '0.75'
2011
+
2012
+ Lint/ShadowedArgument:
2013
+ Description: 'Avoid reassigning arguments before they were used.'
2014
+ Enabled: true
2015
+ VersionAdded: '0.52'
2016
+ IgnoreImplicitReferences: false
2017
+
2018
+
2019
+ Lint/ShadowedException:
2020
+ Description: >-
2021
+ Avoid rescuing a higher level exception
2022
+ before a lower level exception.
2023
+ Enabled: true
2024
+ VersionAdded: '0.41'
2025
+
2026
+ Lint/ShadowingOuterLocalVariable:
2027
+ Description: >-
2028
+ Do not use the same name as outer local variable
2029
+ for block arguments or block local variables.
2030
+ Enabled: true
2031
+ VersionAdded: '0.9'
2032
+
2033
+ Lint/StructNewOverride:
2034
+ Description: 'Disallow overriding the `Struct` built-in methods via `Struct.new`.'
2035
+ Enabled: true
2036
+ VersionAdded: '0.81'
2037
+
2038
+ Lint/SuppressedException:
2039
+ Description: "Don't suppress exceptions."
2040
+ StyleGuide: '#dont-hide-exceptions'
2041
+ Enabled: true
2042
+ AllowComments: true
2043
+ VersionAdded: '0.9'
2044
+ VersionChanged: '0.81'
2045
+
2046
+ Lint/SymbolConversion:
2047
+ Description: 'Checks for unnecessary symbol conversions.'
2048
+ Enabled: pending
2049
+ VersionAdded: '1.9'
2050
+
2051
+ Lint/Syntax:
2052
+ Description: 'Checks for syntax errors.'
2053
+ Enabled: true
2054
+ VersionAdded: '0.9'
2055
+
2056
+ Lint/ToEnumArguments:
2057
+ Description: 'This cop ensures that `to_enum`/`enum_for`, called for the current method, has correct arguments.'
2058
+ Enabled: pending
2059
+ VersionAdded: '1.1'
2060
+
2061
+ Lint/ToJSON:
2062
+ Description: 'Ensure #to_json includes an optional argument.'
2063
+ Enabled: true
2064
+ VersionAdded: '0.66'
2065
+
2066
+ Lint/TopLevelReturnWithArgument:
2067
+ Description: 'This cop detects top level return statements with argument.'
2068
+ Enabled: true
2069
+ VersionAdded: '0.89'
2070
+
2071
+ Lint/TrailingCommaInAttributeDeclaration:
2072
+ Description: 'This cop checks for trailing commas in attribute declarations.'
2073
+ Enabled: true
2074
+ VersionAdded: '0.90'
2075
+
2076
+ Lint/TripleQuotes:
2077
+ Description: 'Checks for useless triple quote constructs.'
2078
+ Enabled: pending
2079
+ VersionAdded: '1.9'
2080
+
2081
+ Lint/UnderscorePrefixedVariableName:
2082
+ Description: 'Do not use prefix `_` for a variable that is used.'
2083
+ Enabled: true
2084
+ VersionAdded: '0.21'
2085
+ AllowKeywordBlockArguments: false
2086
+
2087
+ Lint/UnexpectedBlockArity:
2088
+ Description: 'Looks for blocks that have fewer arguments that the calling method expects.'
2089
+ Enabled: pending
2090
+ Safe: false
2091
+ VersionAdded: '1.5'
2092
+ Methods:
2093
+ chunk_while: 2
2094
+ each_with_index: 2
2095
+ each_with_object: 2
2096
+ inject: 2
2097
+ max: 2
2098
+ min: 2
2099
+ minmax: 2
2100
+ reduce: 2
2101
+ slice_when: 2
2102
+ sort: 2
2103
+
2104
+ Lint/UnifiedInteger:
2105
+ Description: 'Use Integer instead of Fixnum or Bignum.'
2106
+ Enabled: true
2107
+ VersionAdded: '0.43'
2108
+
2109
+ Lint/UnmodifiedReduceAccumulator:
2110
+ Description: Checks for `reduce` or `inject` blocks that do not update the accumulator each iteration.
2111
+ Enabled: pending
2112
+ VersionAdded: '1.1'
2113
+ VersionChanged: '1.5'
2114
+
2115
+ Lint/UnreachableCode:
2116
+ Description: 'Unreachable code.'
2117
+ Enabled: true
2118
+ VersionAdded: '0.9'
2119
+
2120
+ Lint/UnreachableLoop:
2121
+ Description: 'This cop checks for loops that will have at most one iteration.'
2122
+ Enabled: true
2123
+ VersionAdded: '0.89'
2124
+ VersionChanged: '1.7'
2125
+ IgnoredPatterns:
2126
+ # RSpec uses `times` in its message expectations
2127
+ # eg. `exactly(2).times`
2128
+ - !ruby/regexp /(exactly|at_least|at_most)\(\d+\)\.times/
2129
+
2130
+ Lint/UnusedBlockArgument:
2131
+ Description: 'Checks for unused block arguments.'
2132
+ StyleGuide: '#underscore-unused-vars'
2133
+ Enabled: true
2134
+ VersionAdded: '0.21'
2135
+ VersionChanged: '0.22'
2136
+ IgnoreEmptyBlocks: true
2137
+ AllowUnusedKeywordArguments: false
2138
+
2139
+ Lint/UnusedMethodArgument:
2140
+ Description: 'Checks for unused method arguments.'
2141
+ StyleGuide: '#underscore-unused-vars'
2142
+ Enabled: true
2143
+ VersionAdded: '0.21'
2144
+ VersionChanged: '0.81'
2145
+ AllowUnusedKeywordArguments: false
2146
+ IgnoreEmptyMethods: true
2147
+ IgnoreNotImplementedMethods: true
2148
+
2149
+ Lint/UriEscapeUnescape:
2150
+ Description: >-
2151
+ `URI.escape` method is obsolete and should not be used. Instead, use
2152
+ `CGI.escape`, `URI.encode_www_form` or `URI.encode_www_form_component`
2153
+ depending on your specific use case.
2154
+ Also `URI.unescape` method is obsolete and should not be used. Instead, use
2155
+ `CGI.unescape`, `URI.decode_www_form` or `URI.decode_www_form_component`
2156
+ depending on your specific use case.
2157
+ Enabled: true
2158
+ VersionAdded: '0.50'
2159
+
2160
+ Lint/UriRegexp:
2161
+ Description: 'Use `URI::DEFAULT_PARSER.make_regexp` instead of `URI.regexp`.'
2162
+ Enabled: true
2163
+ VersionAdded: '0.50'
2164
+
2165
+ Lint/UselessAccessModifier:
2166
+ Description: 'Checks for useless access modifiers.'
2167
+ Enabled: true
2168
+ VersionAdded: '0.20'
2169
+ VersionChanged: '0.83'
2170
+ ContextCreatingMethods: []
2171
+ MethodCreatingMethods: []
2172
+
2173
+ Lint/UselessAssignment:
2174
+ Description: 'Checks for useless assignment to a local variable.'
2175
+ StyleGuide: '#underscore-unused-vars'
2176
+ Enabled: true
2177
+ VersionAdded: '0.11'
2178
+
2179
+ Lint/UselessElseWithoutRescue:
2180
+ Description: 'Checks for useless `else` in `begin..end` without `rescue`.'
2181
+ Enabled: true
2182
+ VersionAdded: '0.17'
2183
+
2184
+ Lint/UselessMethodDefinition:
2185
+ Description: 'Checks for useless method definitions.'
2186
+ Enabled: true
2187
+ VersionAdded: '0.90'
2188
+ Safe: false
2189
+ AllowComments: true
2190
+
2191
+ Lint/UselessSetterCall:
2192
+ Description: 'Checks for useless setter call to a local variable.'
2193
+ Enabled: true
2194
+ SafeAutoCorrect: false
2195
+ VersionAdded: '0.13'
2196
+ VersionChanged: '1.2'
2197
+ Safe: false
2198
+
2199
+ Lint/UselessTimes:
2200
+ Description: 'Checks for useless `Integer#times` calls.'
2201
+ Enabled: true
2202
+ VersionAdded: '0.91'
2203
+ Safe: false
2204
+
2205
+ Lint/Void:
2206
+ Description: 'Possible use of operator/literal/variable in void context.'
2207
+ Enabled: true
2208
+ VersionAdded: '0.9'
2209
+ CheckForMethodsWithNoSideEffects: false
2210
+
2211
+ #################### Metrics ###############################
2212
+
2213
+ Metrics/AbcSize:
2214
+ Description: >-
2215
+ A calculated magnitude based on number of assignments,
2216
+ branches, and conditions.
2217
+ Reference:
2218
+ - http://c2.com/cgi/wiki?AbcMetric
2219
+ - https://en.wikipedia.org/wiki/ABC_Software_Metric
2220
+ Enabled: true
2221
+ VersionAdded: '0.27'
2222
+ VersionChanged: '1.5'
2223
+ # The ABC size is a calculated magnitude, so this number can be an Integer or
2224
+ # a Float.
2225
+ IgnoredMethods: []
2226
+ CountRepeatedAttributes: true
2227
+ Max: 17
2228
+
2229
+ Metrics/BlockLength:
2230
+ Description: 'Avoid long blocks with many lines.'
2231
+ Enabled: true
2232
+ VersionAdded: '0.44'
2233
+ VersionChanged: '1.5'
2234
+ CountComments: false # count full line comments?
2235
+ Max: 25
2236
+ CountAsOne: []
2237
+ IgnoredMethods:
2238
+ # By default, exclude the `#refine` method, as it tends to have larger
2239
+ # associated blocks.
2240
+ - refine
2241
+ Exclude:
2242
+ - '**/*.gemspec'
2243
+
2244
+ Metrics/BlockNesting:
2245
+ Description: 'Avoid excessive block nesting.'
2246
+ StyleGuide: '#three-is-the-number-thou-shalt-count'
2247
+ Enabled: true
2248
+ VersionAdded: '0.25'
2249
+ VersionChanged: '0.47'
2250
+ CountBlocks: false
2251
+ Max: 3
2252
+
2253
+ Metrics/ClassLength:
2254
+ Description: 'Avoid classes longer than 100 lines of code.'
2255
+ Enabled: true
2256
+ VersionAdded: '0.25'
2257
+ VersionChanged: '0.87'
2258
+ CountComments: false # count full line comments?
2259
+ Max: 100
2260
+ CountAsOne: []
2261
+
2262
+ # Avoid complex methods.
2263
+ Metrics/CyclomaticComplexity:
2264
+ Description: >-
2265
+ A complexity metric that is strongly correlated to the number
2266
+ of test cases needed to validate a method.
2267
+ Enabled: true
2268
+ VersionAdded: '0.25'
2269
+ VersionChanged: '0.81'
2270
+ IgnoredMethods: []
2271
+ Max: 7
2272
+
2273
+ Metrics/MethodLength:
2274
+ Description: 'Avoid methods longer than 10 lines of code.'
2275
+ StyleGuide: '#short-methods'
2276
+ Enabled: true
2277
+ VersionAdded: '0.25'
2278
+ VersionChanged: '1.5'
2279
+ CountComments: false # count full line comments?
2280
+ Max: 10
2281
+ CountAsOne: []
2282
+ IgnoredMethods: []
2283
+
2284
+ Metrics/ModuleLength:
2285
+ Description: 'Avoid modules longer than 100 lines of code.'
2286
+ Enabled: true
2287
+ VersionAdded: '0.31'
2288
+ VersionChanged: '0.87'
2289
+ CountComments: false # count full line comments?
2290
+ Max: 100
2291
+ CountAsOne: []
2292
+
2293
+ Metrics/ParameterLists:
2294
+ Description: 'Avoid parameter lists longer than three or four parameters.'
2295
+ StyleGuide: '#too-many-params'
2296
+ Enabled: true
2297
+ VersionAdded: '0.25'
2298
+ VersionChanged: '1.5'
2299
+ Max: 5
2300
+ CountKeywordArgs: true
2301
+ MaxOptionalParameters: 3
2302
+
2303
+ Metrics/PerceivedComplexity:
2304
+ Description: >-
2305
+ A complexity metric geared towards measuring complexity for a
2306
+ human reader.
2307
+ Enabled: true
2308
+ VersionAdded: '0.25'
2309
+ VersionChanged: '0.81'
2310
+ IgnoredMethods: []
2311
+ Max: 8
2312
+
2313
+ ################## Migration #############################
2314
+
2315
+ Migration/DepartmentName:
2316
+ Description: >-
2317
+ Check that cop names in rubocop:disable (etc) comments are
2318
+ given with department name.
2319
+ Enabled: true
2320
+ VersionAdded: '0.75'
2321
+
2322
+ #################### Naming ##############################
2323
+
2324
+ Naming/AccessorMethodName:
2325
+ Description: Check the naming of accessor methods for get_/set_.
2326
+ StyleGuide: '#accessor_mutator_method_names'
2327
+ Enabled: true
2328
+ VersionAdded: '0.50'
2329
+
2330
+ Naming/AsciiIdentifiers:
2331
+ Description: 'Use only ascii symbols in identifiers and constants.'
2332
+ StyleGuide: '#english-identifiers'
2333
+ Enabled: true
2334
+ VersionAdded: '0.50'
2335
+ VersionChanged: '0.87'
2336
+ AsciiConstants: true
2337
+
2338
+ Naming/BinaryOperatorParameterName:
2339
+ Description: 'When defining binary operators, name the argument other.'
2340
+ StyleGuide: '#other-arg'
2341
+ Enabled: true
2342
+ VersionAdded: '0.50'
2343
+ VersionChanged: '1.2'
2344
+
2345
+ Naming/BlockParameterName:
2346
+ Description: >-
2347
+ Checks for block parameter names that contain capital letters,
2348
+ end in numbers, or do not meet a minimal length.
2349
+ Enabled: true
2350
+ VersionAdded: '0.53'
2351
+ VersionChanged: '0.77'
2352
+ # Parameter names may be equal to or greater than this value
2353
+ MinNameLength: 1
2354
+ AllowNamesEndingInNumbers: true
2355
+ # Allowed names that will not register an offense
2356
+ AllowedNames: []
2357
+ # Forbidden names that will register an offense
2358
+ ForbiddenNames: []
2359
+
2360
+ Naming/ClassAndModuleCamelCase:
2361
+ Description: 'Use CamelCase for classes and modules.'
2362
+ StyleGuide: '#camelcase-classes'
2363
+ Enabled: true
2364
+ VersionAdded: '0.50'
2365
+ VersionChanged: '0.85'
2366
+ # Allowed class/module names can be specified here.
2367
+ # These can be full or part of the name.
2368
+ AllowedNames:
2369
+ - module_parent
2370
+
2371
+ Naming/ConstantName:
2372
+ Description: 'Constants should use SCREAMING_SNAKE_CASE.'
2373
+ StyleGuide: '#screaming-snake-case'
2374
+ Enabled: true
2375
+ VersionAdded: '0.50'
2376
+
2377
+ Naming/FileName:
2378
+ Description: 'Use snake_case for source file names.'
2379
+ StyleGuide: '#snake-case-files'
2380
+ Enabled: true
2381
+ VersionAdded: '0.50'
2382
+ # Camel case file names listed in `AllCops:Include` and all file names listed
2383
+ # in `AllCops:Exclude` are excluded by default. Add extra excludes here.
2384
+ Exclude: []
2385
+ # When `true`, requires that each source file should define a class or module
2386
+ # with a name which matches the file name (converted to ... case).
2387
+ # It further expects it to be nested inside modules which match the names
2388
+ # of subdirectories in its path.
2389
+ ExpectMatchingDefinition: false
2390
+ # When `false`, changes the behavior of ExpectMatchingDefinition to match only
2391
+ # whether each source file's class or module name matches the file name --
2392
+ # not whether the nested module hierarchy matches the subdirectory path.
2393
+ CheckDefinitionPathHierarchy: true
2394
+ # If non-`nil`, expect all source file names to match the following regex.
2395
+ # Only the file name itself is matched, not the entire file path.
2396
+ # Use anchors as necessary if you want to match the entire name rather than
2397
+ # just a part of it.
2398
+ Regex: ~
2399
+ # With `IgnoreExecutableScripts` set to `true`, this cop does not
2400
+ # report offending filenames for executable scripts (i.e. source
2401
+ # files with a shebang in the first line).
2402
+ IgnoreExecutableScripts: true
2403
+ AllowedAcronyms:
2404
+ - CLI
2405
+ - DSL
2406
+ - ACL
2407
+ - API
2408
+ - ASCII
2409
+ - CPU
2410
+ - CSS
2411
+ - DNS
2412
+ - EOF
2413
+ - GUID
2414
+ - HTML
2415
+ - HTTP
2416
+ - HTTPS
2417
+ - ID
2418
+ - IP
2419
+ - JSON
2420
+ - LHS
2421
+ - QPS
2422
+ - RAM
2423
+ - RHS
2424
+ - RPC
2425
+ - SLA
2426
+ - SMTP
2427
+ - SQL
2428
+ - SSH
2429
+ - TCP
2430
+ - TLS
2431
+ - TTL
2432
+ - UDP
2433
+ - UI
2434
+ - UID
2435
+ - UUID
2436
+ - URI
2437
+ - URL
2438
+ - UTF8
2439
+ - VM
2440
+ - XML
2441
+ - XMPP
2442
+ - XSRF
2443
+ - XSS
2444
+
2445
+ Naming/HeredocDelimiterCase:
2446
+ Description: 'Use configured case for heredoc delimiters.'
2447
+ StyleGuide: '#heredoc-delimiters'
2448
+ Enabled: true
2449
+ VersionAdded: '0.50'
2450
+ VersionChanged: '1.2'
2451
+ EnforcedStyle: uppercase
2452
+ SupportedStyles:
2453
+ - lowercase
2454
+ - uppercase
2455
+
2456
+ Naming/HeredocDelimiterNaming:
2457
+ Description: 'Use descriptive heredoc delimiters.'
2458
+ StyleGuide: '#heredoc-delimiters'
2459
+ Enabled: true
2460
+ VersionAdded: '0.50'
2461
+ ForbiddenDelimiters:
2462
+ - !ruby/regexp '/(^|\s)(EO[A-Z]{1}|END)(\s|$)/'
2463
+
2464
+ Naming/MemoizedInstanceVariableName:
2465
+ Description: >-
2466
+ Memoized method name should match memo instance variable name.
2467
+ Enabled: true
2468
+ VersionAdded: '0.53'
2469
+ VersionChanged: '1.2'
2470
+ EnforcedStyleForLeadingUnderscores: disallowed
2471
+ SupportedStylesForLeadingUnderscores:
2472
+ - disallowed
2473
+ - required
2474
+ - optional
2475
+
2476
+ Naming/MethodName:
2477
+ Description: 'Use the configured style when naming methods.'
2478
+ StyleGuide: '#snake-case-symbols-methods-vars'
2479
+ Enabled: true
2480
+ VersionAdded: '0.50'
2481
+ EnforcedStyle: snake_case
2482
+ SupportedStyles:
2483
+ - snake_case
2484
+ - camelCase
2485
+ # Method names matching patterns are always allowed.
2486
+ #
2487
+ # IgnoredPatterns:
2488
+ # - '\A\s*onSelectionBulkChange\s*'
2489
+ # - '\A\s*onSelectionCleared\s*'
2490
+ #
2491
+ IgnoredPatterns: []
2492
+
2493
+ Naming/MethodParameterName:
2494
+ Description: >-
2495
+ Checks for method parameter names that contain capital letters,
2496
+ end in numbers, or do not meet a minimal length.
2497
+ Enabled: true
2498
+ VersionAdded: '0.53'
2499
+ VersionChanged: '0.77'
2500
+ # Parameter names may be equal to or greater than this value
2501
+ MinNameLength: 3
2502
+ AllowNamesEndingInNumbers: true
2503
+ # Allowed names that will not register an offense
2504
+ AllowedNames:
2505
+ - at
2506
+ - by
2507
+ - db
2508
+ - id
2509
+ - in
2510
+ - io
2511
+ - ip
2512
+ - of
2513
+ - 'on'
2514
+ - os
2515
+ - pp
2516
+ - to
2517
+ # Forbidden names that will register an offense
2518
+ ForbiddenNames: []
2519
+
2520
+ Naming/PredicateName:
2521
+ Description: 'Check the names of predicate methods.'
2522
+ StyleGuide: '#bool-methods-qmark'
2523
+ Enabled: true
2524
+ VersionAdded: '0.50'
2525
+ VersionChanged: '0.77'
2526
+ # Predicate name prefixes.
2527
+ NamePrefix:
2528
+ - is_
2529
+ - has_
2530
+ - have_
2531
+ # Predicate name prefixes that should be removed.
2532
+ ForbiddenPrefixes:
2533
+ - is_
2534
+ - has_
2535
+ - have_
2536
+ # Predicate names which, despite having a forbidden prefix, or no `?`,
2537
+ # should still be accepted
2538
+ AllowedMethods:
2539
+ - is_a?
2540
+ # Method definition macros for dynamically generated methods.
2541
+ MethodDefinitionMacros:
2542
+ - define_method
2543
+ - define_singleton_method
2544
+ # Exclude Rspec specs because there is a strong convention to write spec
2545
+ # helpers in the form of `have_something` or `be_something`.
2546
+ Exclude:
2547
+ - 'spec/**/*'
2548
+
2549
+ Naming/RescuedExceptionsVariableName:
2550
+ Description: 'Use consistent rescued exceptions variables naming.'
2551
+ Enabled: true
2552
+ VersionAdded: '0.67'
2553
+ VersionChanged: '0.68'
2554
+ PreferredName: e
2555
+
2556
+ Naming/VariableName:
2557
+ Description: 'Use the configured style when naming variables.'
2558
+ StyleGuide: '#snake-case-symbols-methods-vars'
2559
+ Enabled: true
2560
+ VersionAdded: '0.50'
2561
+ VersionChanged: '1.8'
2562
+ EnforcedStyle: snake_case
2563
+ SupportedStyles:
2564
+ - snake_case
2565
+ - camelCase
2566
+ AllowedIdentifiers: []
2567
+
2568
+ Naming/VariableNumber:
2569
+ Description: 'Use the configured style when numbering symbols, methods and variables.'
2570
+ StyleGuide: '#snake-case-symbols-methods-vars-with-numbers'
2571
+ Enabled: true
2572
+ VersionAdded: '0.50'
2573
+ VersionChanged: '1.4'
2574
+ EnforcedStyle: normalcase
2575
+ SupportedStyles:
2576
+ - snake_case
2577
+ - normalcase
2578
+ - non_integer
2579
+ CheckMethodNames: true
2580
+ CheckSymbols: true
2581
+ AllowedIdentifiers:
2582
+ - capture3 # Open3.capture3
2583
+ - iso8601 # Time#iso8601
2584
+ - rfc1123_date # CGI.rfc1123_date
2585
+ - rfc822 # Time#rfc822
2586
+ - rfc2822 # Time#rfc2822
2587
+ - rfc3339 # DateTime.rfc3339
2588
+
2589
+ #################### Security ##############################
2590
+
2591
+ Security/Eval:
2592
+ Description: 'The use of eval represents a serious security risk.'
2593
+ Enabled: true
2594
+ VersionAdded: '0.47'
2595
+
2596
+ Security/JSONLoad:
2597
+ Description: >-
2598
+ Prefer usage of `JSON.parse` over `JSON.load` due to potential
2599
+ security issues. See reference for more information.
2600
+ Reference: 'https://ruby-doc.org/stdlib-2.7.0/libdoc/json/rdoc/JSON.html#method-i-load'
2601
+ Enabled: true
2602
+ VersionAdded: '0.43'
2603
+ VersionChanged: '0.44'
2604
+ # Autocorrect here will change to a method that may cause crashes depending
2605
+ # on the value of the argument.
2606
+ AutoCorrect: false
2607
+ SafeAutoCorrect: false
2608
+
2609
+ Security/MarshalLoad:
2610
+ Description: >-
2611
+ Avoid using of `Marshal.load` or `Marshal.restore` due to potential
2612
+ security issues. See reference for more information.
2613
+ Reference: 'https://ruby-doc.org/core-2.7.0/Marshal.html#module-Marshal-label-Security+considerations'
2614
+ Enabled: true
2615
+ VersionAdded: '0.47'
2616
+
2617
+ Security/Open:
2618
+ Description: 'The use of `Kernel#open` and `URI.open` represent a serious security risk.'
2619
+ Enabled: true
2620
+ VersionAdded: '0.53'
2621
+ VersionChanged: '1.0'
2622
+ Safe: false
2623
+
2624
+ Security/YAMLLoad:
2625
+ Description: >-
2626
+ Prefer usage of `YAML.safe_load` over `YAML.load` due to potential
2627
+ security issues. See reference for more information.
2628
+ Reference: 'https://ruby-doc.org/stdlib-2.7.0/libdoc/yaml/rdoc/YAML.html#module-YAML-label-Security'
2629
+ Enabled: true
2630
+ VersionAdded: '0.47'
2631
+ SafeAutoCorrect: false
2632
+
2633
+ #################### Style ###############################
2634
+
2635
+ Style/AccessModifierDeclarations:
2636
+ Description: 'Checks style of how access modifiers are used.'
2637
+ Enabled: true
2638
+ VersionAdded: '0.57'
2639
+ VersionChanged: '0.81'
2640
+ EnforcedStyle: group
2641
+ SupportedStyles:
2642
+ - inline
2643
+ - group
2644
+ AllowModifiersOnSymbols: true
2645
+
2646
+ Style/AccessorGrouping:
2647
+ Description: 'Checks for grouping of accessors in `class` and `module` bodies.'
2648
+ Enabled: true
2649
+ VersionAdded: '0.87'
2650
+ EnforcedStyle: grouped
2651
+ SupportedStyles:
2652
+ # separated: each accessor goes in a separate statement.
2653
+ # grouped: accessors are grouped into a single statement.
2654
+ - separated
2655
+ - grouped
2656
+
2657
+ Style/Alias:
2658
+ Description: 'Use alias instead of alias_method.'
2659
+ StyleGuide: '#alias-method-lexically'
2660
+ Enabled: true
2661
+ VersionAdded: '0.9'
2662
+ VersionChanged: '0.36'
2663
+ EnforcedStyle: prefer_alias
2664
+ SupportedStyles:
2665
+ - prefer_alias
2666
+ - prefer_alias_method
2667
+
2668
+ Style/AndOr:
2669
+ Description: 'Use &&/|| instead of and/or.'
2670
+ StyleGuide: '#no-and-or-or'
2671
+ Enabled: true
2672
+ VersionAdded: '0.9'
2673
+ VersionChanged: '0.25'
2674
+ # Whether `and` and `or` are banned only in conditionals (conditionals)
2675
+ # or completely (always).
2676
+ EnforcedStyle: conditionals
2677
+ SupportedStyles:
2678
+ - always
2679
+ - conditionals
2680
+
2681
+ Style/ArgumentsForwarding:
2682
+ Description: 'Use arguments forwarding.'
2683
+ StyleGuide: '#arguments-forwarding'
2684
+ Enabled: pending
2685
+ AllowOnlyRestArgument: true
2686
+ VersionAdded: '1.1'
2687
+
2688
+ Style/ArrayCoercion:
2689
+ Description: >-
2690
+ Use Array() instead of explicit Array check or [*var], when dealing
2691
+ with a variable you want to treat as an Array, but you're not certain it's an array.
2692
+ StyleGuide: '#array-coercion'
2693
+ Safe: false
2694
+ Enabled: false
2695
+ VersionAdded: '0.88'
2696
+
2697
+ Style/ArrayJoin:
2698
+ Description: 'Use Array#join instead of Array#*.'
2699
+ StyleGuide: '#array-join'
2700
+ Enabled: true
2701
+ VersionAdded: '0.20'
2702
+ VersionChanged: '0.31'
2703
+
2704
+ Style/AsciiComments:
2705
+ Description: 'Use only ascii symbols in comments.'
2706
+ StyleGuide: '#english-comments'
2707
+ Enabled: true
2708
+ VersionAdded: '0.9'
2709
+ VersionChanged: '0.52'
2710
+ AllowedChars:
2711
+ - ©
2712
+
2713
+ Style/Attr:
2714
+ Description: 'Checks for uses of Module#attr.'
2715
+ StyleGuide: '#attr'
2716
+ Enabled: true
2717
+ VersionAdded: '0.9'
2718
+ VersionChanged: '0.12'
2719
+
2720
+ Style/AutoResourceCleanup:
2721
+ Description: 'Suggests the usage of an auto resource cleanup version of a method (if available).'
2722
+ Enabled: false
2723
+ VersionAdded: '0.30'
2724
+
2725
+ Style/BarePercentLiterals:
2726
+ Description: 'Checks if usage of %() or %Q() matches configuration.'
2727
+ StyleGuide: '#percent-q-shorthand'
2728
+ Enabled: true
2729
+ VersionAdded: '0.25'
2730
+ EnforcedStyle: bare_percent
2731
+ SupportedStyles:
2732
+ - percent_q
2733
+ - bare_percent
2734
+
2735
+ Style/BeginBlock:
2736
+ Description: 'Avoid the use of BEGIN blocks.'
2737
+ StyleGuide: '#no-BEGIN-blocks'
2738
+ Enabled: true
2739
+ VersionAdded: '0.9'
2740
+
2741
+ Style/BisectedAttrAccessor:
2742
+ Description: >-
2743
+ Checks for places where `attr_reader` and `attr_writer`
2744
+ for the same method can be combined into single `attr_accessor`.
2745
+ Enabled: true
2746
+ VersionAdded: '0.87'
2747
+
2748
+ Style/BlockComments:
2749
+ Description: 'Do not use block comments.'
2750
+ StyleGuide: '#no-block-comments'
2751
+ Enabled: true
2752
+ VersionAdded: '0.9'
2753
+ VersionChanged: '0.23'
2754
+
2755
+ Style/BlockDelimiters:
2756
+ Description: >-
2757
+ Avoid using {...} for multi-line blocks (multiline chaining is
2758
+ always ugly).
2759
+ Prefer {...} over do...end for single-line blocks.
2760
+ StyleGuide: '#single-line-blocks'
2761
+ Enabled: true
2762
+ VersionAdded: '0.30'
2763
+ VersionChanged: '0.35'
2764
+ EnforcedStyle: line_count_based
2765
+ SupportedStyles:
2766
+ # The `line_count_based` style enforces braces around single line blocks and
2767
+ # do..end around multi-line blocks.
2768
+ - line_count_based
2769
+ # The `semantic` style enforces braces around functional blocks, where the
2770
+ # primary purpose of the block is to return a value and do..end for
2771
+ # multi-line procedural blocks, where the primary purpose of the block is
2772
+ # its side-effects. Single-line procedural blocks may only use do-end,
2773
+ # unless AllowBracesOnProceduralOneLiners has a truthy value (see below).
2774
+ #
2775
+ # This looks at the usage of a block's method to determine its type (e.g. is
2776
+ # the result of a `map` assigned to a variable or passed to another
2777
+ # method) but exceptions are permitted in the `ProceduralMethods`,
2778
+ # `FunctionalMethods` and `IgnoredMethods` sections below.
2779
+ - semantic
2780
+ # The `braces_for_chaining` style enforces braces around single line blocks
2781
+ # and do..end around multi-line blocks, except for multi-line blocks whose
2782
+ # return value is being chained with another method (in which case braces
2783
+ # are enforced).
2784
+ - braces_for_chaining
2785
+ # The `always_braces` style always enforces braces.
2786
+ - always_braces
2787
+ ProceduralMethods:
2788
+ # Methods that are known to be procedural in nature but look functional from
2789
+ # their usage, e.g.
2790
+ #
2791
+ # time = Benchmark.realtime do
2792
+ # foo.bar
2793
+ # end
2794
+ #
2795
+ # Here, the return value of the block is discarded but the return value of
2796
+ # `Benchmark.realtime` is used.
2797
+ - benchmark
2798
+ - bm
2799
+ - bmbm
2800
+ - create
2801
+ - each_with_object
2802
+ - measure
2803
+ - new
2804
+ - realtime
2805
+ - tap
2806
+ - with_object
2807
+ FunctionalMethods:
2808
+ # Methods that are known to be functional in nature but look procedural from
2809
+ # their usage, e.g.
2810
+ #
2811
+ # let(:foo) { Foo.new }
2812
+ #
2813
+ # Here, the return value of `Foo.new` is used to define a `foo` helper but
2814
+ # doesn't appear to be used from the return value of `let`.
2815
+ - let
2816
+ - let!
2817
+ - subject
2818
+ - watch
2819
+ IgnoredMethods:
2820
+ # Methods that can be either procedural or functional and cannot be
2821
+ # categorised from their usage alone, e.g.
2822
+ #
2823
+ # foo = lambda do |x|
2824
+ # puts "Hello, #{x}"
2825
+ # end
2826
+ #
2827
+ # foo = lambda do |x|
2828
+ # x * 100
2829
+ # end
2830
+ #
2831
+ # Here, it is impossible to tell from the return value of `lambda` whether
2832
+ # the inner block's return value is significant.
2833
+ - lambda
2834
+ - proc
2835
+ - it
2836
+ # The AllowBracesOnProceduralOneLiners option is ignored unless the
2837
+ # EnforcedStyle is set to `semantic`. If so:
2838
+ #
2839
+ # If AllowBracesOnProceduralOneLiners is unspecified, or set to any
2840
+ # falsey value, then semantic purity is maintained, so one-line
2841
+ # procedural blocks must use do-end, not braces.
2842
+ #
2843
+ # # bad
2844
+ # collection.each { |element| puts element }
2845
+ #
2846
+ # # good
2847
+ # collection.each do |element| puts element end
2848
+ #
2849
+ # If AllowBracesOnProceduralOneLiners is set to any truthy value,
2850
+ # then one-line procedural blocks may use either style.
2851
+ #
2852
+ # # good
2853
+ # collection.each { |element| puts element }
2854
+ #
2855
+ # # also good
2856
+ # collection.each do |element| puts element end
2857
+ AllowBracesOnProceduralOneLiners: false
2858
+ # The BracesRequiredMethods overrides all other configurations except
2859
+ # IgnoredMethods. It can be used to enforce that all blocks for specific
2860
+ # methods use braces. For example, you can use this to enforce Sorbet
2861
+ # signatures use braces even when the rest of your codebase enforces
2862
+ # the `line_count_based` style.
2863
+ BracesRequiredMethods: []
2864
+
2865
+ Style/CaseEquality:
2866
+ Description: 'Avoid explicit use of the case equality operator(===).'
2867
+ StyleGuide: '#no-case-equality'
2868
+ Enabled: true
2869
+ VersionAdded: '0.9'
2870
+ VersionChanged: '0.89'
2871
+ # If AllowOnConstant is enabled, the cop will ignore violations when the receiver of
2872
+ # the case equality operator is a constant.
2873
+ #
2874
+ # # bad
2875
+ # /string/ === "string"
2876
+ #
2877
+ # # good
2878
+ # String === "string"
2879
+ AllowOnConstant: false
2880
+
2881
+ Style/CaseLikeIf:
2882
+ Description: 'This cop identifies places where `if-elsif` constructions can be replaced with `case-when`.'
2883
+ StyleGuide: '#case-vs-if-else'
2884
+ Enabled: true
2885
+ Safe: false
2886
+ VersionAdded: '0.88'
2887
+
2888
+ Style/CharacterLiteral:
2889
+ Description: 'Checks for uses of character literals.'
2890
+ StyleGuide: '#no-character-literals'
2891
+ Enabled: true
2892
+ VersionAdded: '0.9'
2893
+
2894
+ Style/ClassAndModuleChildren:
2895
+ Description: 'Checks style of children classes and modules.'
2896
+ StyleGuide: '#namespace-definition'
2897
+ # Moving from compact to nested children requires knowledge of whether the
2898
+ # outer parent is a module or a class. Moving from nested to compact requires
2899
+ # verification that the outer parent is defined elsewhere. Rubocop does not
2900
+ # have the knowledge to perform either operation safely and thus requires
2901
+ # manual oversight.
2902
+ SafeAutoCorrect: false
2903
+ Enabled: true
2904
+ VersionAdded: '0.19'
2905
+ #
2906
+ # Basically there are two different styles:
2907
+ #
2908
+ # `nested` - have each child on a separate line
2909
+ # class Foo
2910
+ # class Bar
2911
+ # end
2912
+ # end
2913
+ #
2914
+ # `compact` - combine definitions as much as possible
2915
+ # class Foo::Bar
2916
+ # end
2917
+ #
2918
+ # The compact style is only forced, for classes or modules with one child.
2919
+ EnforcedStyle: nested
2920
+ SupportedStyles:
2921
+ - nested
2922
+ - compact
2923
+
2924
+ Style/ClassCheck:
2925
+ Description: 'Enforces consistent use of `Object#is_a?` or `Object#kind_of?`.'
2926
+ StyleGuide: '#is-a-vs-kind-of'
2927
+ Enabled: true
2928
+ VersionAdded: '0.24'
2929
+ EnforcedStyle: is_a?
2930
+ SupportedStyles:
2931
+ - is_a?
2932
+ - kind_of?
2933
+
2934
+ Style/ClassEqualityComparison:
2935
+ Description: 'Enforces the use of `Object#instance_of?` instead of class comparison for equality.'
2936
+ StyleGuide: '#instance-of-vs-class-comparison'
2937
+ Enabled: true
2938
+ VersionAdded: '0.93'
2939
+ IgnoredMethods:
2940
+ - ==
2941
+ - equal?
2942
+ - eql?
2943
+
2944
+ Style/ClassMethods:
2945
+ Description: 'Use self when defining module/class methods.'
2946
+ StyleGuide: '#def-self-class-methods'
2947
+ Enabled: true
2948
+ VersionAdded: '0.9'
2949
+ VersionChanged: '0.20'
2950
+
2951
+ Style/ClassMethodsDefinitions:
2952
+ Description: 'Enforces using `def self.method_name` or `class << self` to define class methods.'
2953
+ StyleGuide: '#def-self-class-methods'
2954
+ Enabled: false
2955
+ VersionAdded: '0.89'
2956
+ EnforcedStyle: def_self
2957
+ SupportedStyles:
2958
+ - def_self
2959
+ - self_class
2960
+
2961
+ Style/ClassVars:
2962
+ Description: 'Avoid the use of class variables.'
2963
+ StyleGuide: '#no-class-vars'
2964
+ Enabled: true
2965
+ VersionAdded: '0.13'
2966
+
2967
+ Style/CollectionCompact:
2968
+ Description: 'Use `{Array,Hash}#{compact,compact!}` instead of custom logic to reject nils.'
2969
+ Enabled: pending
2970
+ Safe: false
2971
+ VersionAdded: '1.2'
2972
+ VersionChanged: '1.3'
2973
+
2974
+ # Align with the style guide.
2975
+ Style/CollectionMethods:
2976
+ Description: 'Preferred collection methods.'
2977
+ StyleGuide: '#map-find-select-reduce-include-size'
2978
+ Enabled: false
2979
+ VersionAdded: '0.9'
2980
+ VersionChanged: '1.7'
2981
+ Safe: false
2982
+ # Mapping from undesired method to desired method
2983
+ # e.g. to use `detect` over `find`:
2984
+ #
2985
+ # Style/CollectionMethods:
2986
+ # PreferredMethods:
2987
+ # find: detect
2988
+ PreferredMethods:
2989
+ collect: 'map'
2990
+ collect!: 'map!'
2991
+ inject: 'reduce'
2992
+ detect: 'find'
2993
+ find_all: 'select'
2994
+ member?: 'include?'
2995
+ # Methods in this array accept a final symbol as an implicit block
2996
+ # eg. `inject(:+)`
2997
+ MethodsAcceptingSymbol:
2998
+ - inject
2999
+ - reduce
3000
+
3001
+ Style/ColonMethodCall:
3002
+ Description: 'Do not use :: for method call.'
3003
+ StyleGuide: '#double-colons'
3004
+ Enabled: true
3005
+ VersionAdded: '0.9'
3006
+
3007
+ Style/ColonMethodDefinition:
3008
+ Description: 'Do not use :: for defining class methods.'
3009
+ StyleGuide: '#colon-method-definition'
3010
+ Enabled: true
3011
+ VersionAdded: '0.52'
3012
+
3013
+ Style/CombinableLoops:
3014
+ Description: >-
3015
+ Checks for places where multiple consecutive loops over the same data
3016
+ can be combined into a single loop.
3017
+ Enabled: true
3018
+ Safe: false
3019
+ VersionAdded: '0.90'
3020
+
3021
+ Style/CommandLiteral:
3022
+ Description: 'Use `` or %x around command literals.'
3023
+ StyleGuide: '#percent-x'
3024
+ Enabled: true
3025
+ VersionAdded: '0.30'
3026
+ EnforcedStyle: backticks
3027
+ # backticks: Always use backticks.
3028
+ # percent_x: Always use `%x`.
3029
+ # mixed: Use backticks on single-line commands, and `%x` on multi-line commands.
3030
+ SupportedStyles:
3031
+ - backticks
3032
+ - percent_x
3033
+ - mixed
3034
+ # If `false`, the cop will always recommend using `%x` if one or more backticks
3035
+ # are found in the command string.
3036
+ AllowInnerBackticks: false
3037
+
3038
+ # Checks formatting of special comments
3039
+ Style/CommentAnnotation:
3040
+ Description: >-
3041
+ Checks formatting of special comments
3042
+ (TODO, FIXME, OPTIMIZE, HACK, REVIEW, NOTE).
3043
+ StyleGuide: '#annotate-keywords'
3044
+ Enabled: true
3045
+ VersionAdded: '0.10'
3046
+ VersionChanged: '1.3'
3047
+ Keywords:
3048
+ - TODO
3049
+ - FIXME
3050
+ - OPTIMIZE
3051
+ - HACK
3052
+ - REVIEW
3053
+ - NOTE
3054
+
3055
+ Style/CommentedKeyword:
3056
+ Description: 'Do not place comments on the same line as certain keywords.'
3057
+ Enabled: true
3058
+ VersionAdded: '0.51'
3059
+ VersionChanged: '1.7'
3060
+
3061
+ Style/ConditionalAssignment:
3062
+ Description: >-
3063
+ Use the return value of `if` and `case` statements for
3064
+ assignment to a variable and variable comparison instead
3065
+ of assigning that variable inside of each branch.
3066
+ Enabled: true
3067
+ VersionAdded: '0.36'
3068
+ VersionChanged: '0.47'
3069
+ EnforcedStyle: assign_to_condition
3070
+ SupportedStyles:
3071
+ - assign_to_condition
3072
+ - assign_inside_condition
3073
+ # When configured to `assign_to_condition`, `SingleLineConditionsOnly`
3074
+ # will only register an offense when all branches of a condition are
3075
+ # a single line.
3076
+ # When configured to `assign_inside_condition`, `SingleLineConditionsOnly`
3077
+ # will only register an offense for assignment to a condition that has
3078
+ # at least one multiline branch.
3079
+ SingleLineConditionsOnly: true
3080
+ IncludeTernaryExpressions: true
3081
+
3082
+ Style/ConstantVisibility:
3083
+ Description: >-
3084
+ Check that class- and module constants have
3085
+ visibility declarations.
3086
+ Enabled: false
3087
+ VersionAdded: '0.66'
3088
+
3089
+ # Checks that you have put a copyright in a comment before any code.
3090
+ #
3091
+ # You can override the default Notice in your .rubocop.yml file.
3092
+ #
3093
+ # In order to use autocorrect, you must supply a value for the
3094
+ # `AutocorrectNotice` key that matches the regexp Notice. A blank
3095
+ # `AutocorrectNotice` will cause an error during autocorrect.
3096
+ #
3097
+ # Autocorrect will add a copyright notice in a comment at the top
3098
+ # of the file immediately after any shebang or encoding comments.
3099
+ #
3100
+ # Example rubocop.yml:
3101
+ #
3102
+ # Style/Copyright:
3103
+ # Enabled: true
3104
+ # Notice: 'Copyright (\(c\) )?2015 Yahoo! Inc'
3105
+ # AutocorrectNotice: '# Copyright (c) 2015 Yahoo! Inc.'
3106
+ #
3107
+ Style/Copyright:
3108
+ Description: 'Include a copyright notice in each file before any code.'
3109
+ Enabled: false
3110
+ VersionAdded: '0.30'
3111
+ Notice: '^Copyright (\(c\) )?2[0-9]{3} .+'
3112
+ AutocorrectNotice: ''
3113
+
3114
+ Style/DateTime:
3115
+ Description: 'Use Time over DateTime.'
3116
+ StyleGuide: '#date--time'
3117
+ Enabled: false
3118
+ VersionAdded: '0.51'
3119
+ VersionChanged: '0.92'
3120
+ SafeAutoCorrect: false
3121
+ AllowCoercion: false
3122
+
3123
+ Style/DefWithParentheses:
3124
+ Description: 'Use def with parentheses when there are arguments.'
3125
+ StyleGuide: '#method-parens'
3126
+ Enabled: true
3127
+ VersionAdded: '0.9'
3128
+ VersionChanged: '0.12'
3129
+
3130
+ Style/Dir:
3131
+ Description: >-
3132
+ Use the `__dir__` method to retrieve the canonicalized
3133
+ absolute path to the current file.
3134
+ Enabled: true
3135
+ VersionAdded: '0.50'
3136
+
3137
+ Style/DisableCopsWithinSourceCodeDirective:
3138
+ Description: >-
3139
+ Forbids disabling/enabling cops within source code.
3140
+ Enabled: false
3141
+ VersionAdded: '0.82'
3142
+ VersionChanged: '1.9'
3143
+ AllowedCops: []
3144
+
3145
+ Style/DocumentDynamicEvalDefinition:
3146
+ Description: >-
3147
+ When using `class_eval` (or other `eval`) with string interpolation,
3148
+ add a comment block showing its appearance if interpolated.
3149
+ StyleGuide: '#eval-comment-docs'
3150
+ Enabled: pending
3151
+ VersionAdded: '1.1'
3152
+ VersionChanged: '1.3'
3153
+
3154
+ Style/Documentation:
3155
+ Description: 'Document classes and non-namespace modules.'
3156
+ Enabled: true
3157
+ VersionAdded: '0.9'
3158
+ Exclude:
3159
+ - 'spec/**/*'
3160
+ - 'test/**/*'
3161
+
3162
+ Style/DocumentationMethod:
3163
+ Description: 'Checks for missing documentation comment for public methods.'
3164
+ Enabled: false
3165
+ VersionAdded: '0.43'
3166
+ Exclude:
3167
+ - 'spec/**/*'
3168
+ - 'test/**/*'
3169
+ RequireForNonPublicMethods: false
3170
+
3171
+ Style/DoubleCopDisableDirective:
3172
+ Description: 'Checks for double rubocop:disable comments on a single line.'
3173
+ Enabled: true
3174
+ VersionAdded: '0.73'
3175
+
3176
+ Style/DoubleNegation:
3177
+ Description: 'Checks for uses of double negation (!!).'
3178
+ StyleGuide: '#no-bang-bang'
3179
+ Enabled: true
3180
+ VersionAdded: '0.19'
3181
+ VersionChanged: '1.2'
3182
+ EnforcedStyle: allowed_in_returns
3183
+ SafeAutoCorrect: false
3184
+ SupportedStyles:
3185
+ - allowed_in_returns
3186
+ - forbidden
3187
+
3188
+ Style/EachForSimpleLoop:
3189
+ Description: >-
3190
+ Use `Integer#times` for a simple loop which iterates a fixed
3191
+ number of times.
3192
+ Enabled: true
3193
+ VersionAdded: '0.41'
3194
+
3195
+ Style/EachWithObject:
3196
+ Description: 'Prefer `each_with_object` over `inject` or `reduce`.'
3197
+ Enabled: true
3198
+ VersionAdded: '0.22'
3199
+ VersionChanged: '0.42'
3200
+
3201
+ Style/EmptyBlockParameter:
3202
+ Description: 'Omit pipes for empty block parameters.'
3203
+ Enabled: true
3204
+ VersionAdded: '0.52'
3205
+
3206
+ Style/EmptyCaseCondition:
3207
+ Description: 'Avoid empty condition in case statements.'
3208
+ Enabled: true
3209
+ VersionAdded: '0.40'
3210
+
3211
+ Style/EmptyElse:
3212
+ Description: 'Avoid empty else-clauses.'
3213
+ Enabled: true
3214
+ VersionAdded: '0.28'
3215
+ VersionChanged: '0.32'
3216
+ EnforcedStyle: both
3217
+ # empty - warn only on empty `else`
3218
+ # nil - warn on `else` with nil in it
3219
+ # both - warn on empty `else` and `else` with `nil` in it
3220
+ SupportedStyles:
3221
+ - empty
3222
+ - nil
3223
+ - both
3224
+
3225
+ Style/EmptyLambdaParameter:
3226
+ Description: 'Omit parens for empty lambda parameters.'
3227
+ Enabled: true
3228
+ VersionAdded: '0.52'
3229
+
3230
+ Style/EmptyLiteral:
3231
+ Description: 'Prefer literals to Array.new/Hash.new/String.new.'
3232
+ StyleGuide: '#literal-array-hash'
3233
+ Enabled: true
3234
+ VersionAdded: '0.9'
3235
+ VersionChanged: '0.12'
3236
+
3237
+ Style/EmptyMethod:
3238
+ Description: 'Checks the formatting of empty method definitions.'
3239
+ StyleGuide: '#no-single-line-methods'
3240
+ Enabled: true
3241
+ VersionAdded: '0.46'
3242
+ EnforcedStyle: compact
3243
+ SupportedStyles:
3244
+ - compact
3245
+ - expanded
3246
+
3247
+ Style/Encoding:
3248
+ Description: 'Use UTF-8 as the source file encoding.'
3249
+ StyleGuide: '#utf-8'
3250
+ Enabled: true
3251
+ VersionAdded: '0.9'
3252
+ VersionChanged: '0.50'
3253
+
3254
+ Style/EndBlock:
3255
+ Description: 'Avoid the use of END blocks.'
3256
+ StyleGuide: '#no-END-blocks'
3257
+ Enabled: true
3258
+ VersionAdded: '0.9'
3259
+ VersionChanged: '0.81'
3260
+
3261
+ Style/EndlessMethod:
3262
+ Description: 'Avoid the use of multi-lined endless method definitions.'
3263
+ StyleGuide: '#endless-methods'
3264
+ Enabled: pending
3265
+ VersionAdded: '1.8'
3266
+ EnforcedStyle: allow_single_line
3267
+ SupportedStyles:
3268
+ - allow_single_line
3269
+ - allow_always
3270
+ - disallow
3271
+
3272
+ Style/EvalWithLocation:
3273
+ Description: 'Pass `__FILE__` and `__LINE__` to `eval` method, as they are used by backtraces.'
3274
+ Enabled: true
3275
+ VersionAdded: '0.52'
3276
+
3277
+ Style/EvenOdd:
3278
+ Description: 'Favor the use of `Integer#even?` && `Integer#odd?`.'
3279
+ StyleGuide: '#predicate-methods'
3280
+ Enabled: true
3281
+ VersionAdded: '0.12'
3282
+ VersionChanged: '0.29'
3283
+
3284
+ Style/ExpandPathArguments:
3285
+ Description: "Use `expand_path(__dir__)` instead of `expand_path('..', __FILE__)`."
3286
+ Enabled: true
3287
+ VersionAdded: '0.53'
3288
+
3289
+ Style/ExplicitBlockArgument:
3290
+ Description: >-
3291
+ Consider using explicit block argument to avoid writing block literal
3292
+ that just passes its arguments to another block.
3293
+ StyleGuide: '#block-argument'
3294
+ Enabled: true
3295
+ VersionAdded: '0.89'
3296
+ VersionChanged: '1.8'
3297
+
3298
+ Style/ExponentialNotation:
3299
+ Description: 'When using exponential notation, favor a mantissa between 1 (inclusive) and 10 (exclusive).'
3300
+ StyleGuide: '#exponential-notation'
3301
+ Enabled: true
3302
+ VersionAdded: '0.82'
3303
+ EnforcedStyle: scientific
3304
+ SupportedStyles:
3305
+ - scientific
3306
+ - engineering
3307
+ - integral
3308
+
3309
+ Style/FloatDivision:
3310
+ Description: 'For performing float division, coerce one side only.'
3311
+ StyleGuide: '#float-division'
3312
+ Reference: 'https://blog.rubystyle.guide/ruby/2019/06/21/float-division.html'
3313
+ Enabled: true
3314
+ VersionAdded: '0.72'
3315
+ VersionChanged: '1.9'
3316
+ Safe: false
3317
+ EnforcedStyle: single_coerce
3318
+ SupportedStyles:
3319
+ - left_coerce
3320
+ - right_coerce
3321
+ - single_coerce
3322
+ - fdiv
3323
+
3324
+ Style/For:
3325
+ Description: 'Checks use of for or each in multiline loops.'
3326
+ StyleGuide: '#no-for-loops'
3327
+ Enabled: true
3328
+ VersionAdded: '0.13'
3329
+ VersionChanged: '0.59'
3330
+ EnforcedStyle: each
3331
+ SupportedStyles:
3332
+ - each
3333
+ - for
3334
+
3335
+ Style/FormatString:
3336
+ Description: 'Enforce the use of Kernel#sprintf, Kernel#format or String#%.'
3337
+ StyleGuide: '#sprintf'
3338
+ Enabled: true
3339
+ VersionAdded: '0.19'
3340
+ VersionChanged: '0.49'
3341
+ EnforcedStyle: format
3342
+ SupportedStyles:
3343
+ - format
3344
+ - sprintf
3345
+ - percent
3346
+
3347
+ Style/FormatStringToken:
3348
+ Description: 'Use a consistent style for format string tokens.'
3349
+ Enabled: true
3350
+ EnforcedStyle: annotated
3351
+ SupportedStyles:
3352
+ # Prefer tokens which contain a sprintf like type annotation like
3353
+ # `%<name>s`, `%<age>d`, `%<score>f`
3354
+ - annotated
3355
+ # Prefer simple looking "template" style tokens like `%{name}`, `%{age}`
3356
+ - template
3357
+ - unannotated
3358
+ # `MaxUnannotatedPlaceholdersAllowed` defines the number of `unannotated`
3359
+ # style token in a format string to be allowed when enforced style is not
3360
+ # `unannotated`.
3361
+ MaxUnannotatedPlaceholdersAllowed: 1
3362
+ VersionAdded: '0.49'
3363
+ VersionChanged: '1.0'
3364
+ IgnoredMethods: []
3365
+
3366
+ Style/FrozenStringLiteralComment:
3367
+ Description: >-
3368
+ Add the frozen_string_literal comment to the top of files
3369
+ to help transition to frozen string literals by default.
3370
+ Enabled: true
3371
+ VersionAdded: '0.36'
3372
+ VersionChanged: '0.79'
3373
+ EnforcedStyle: always
3374
+ SupportedStyles:
3375
+ # `always` will always add the frozen string literal comment to a file
3376
+ # regardless of the Ruby version or if `freeze` or `<<` are called on a
3377
+ # string literal. It is possible that this will create errors.
3378
+ - always
3379
+ # `always_true` will add the frozen string literal comment to a file,
3380
+ # similarly to the `always` style, but will also change any disabled
3381
+ # comments (e.g. `# frozen_string_literal: false`) to be enabled.
3382
+ - always_true
3383
+ # `never` will enforce that the frozen string literal comment does not
3384
+ # exist in a file.
3385
+ - never
3386
+ SafeAutoCorrect: false
3387
+
3388
+ Style/GlobalStdStream:
3389
+ Description: 'Enforces the use of `$stdout/$stderr/$stdin` instead of `STDOUT/STDERR/STDIN`.'
3390
+ StyleGuide: '#global-stdout'
3391
+ Enabled: true
3392
+ VersionAdded: '0.89'
3393
+ SafeAutoCorrect: false
3394
+
3395
+ Style/GlobalVars:
3396
+ Description: 'Do not introduce global variables.'
3397
+ StyleGuide: '#instance-vars'
3398
+ Reference: 'https://www.zenspider.com/ruby/quickref.html'
3399
+ Enabled: true
3400
+ VersionAdded: '0.13'
3401
+ # Built-in global variables are allowed by default.
3402
+ AllowedVariables: []
3403
+
3404
+ Style/GuardClause:
3405
+ Description: 'Check for conditionals that can be replaced with guard clauses.'
3406
+ StyleGuide: '#no-nested-conditionals'
3407
+ Enabled: true
3408
+ VersionAdded: '0.20'
3409
+ VersionChanged: '0.22'
3410
+ # `MinBodyLength` defines the number of lines of the a body of an `if` or `unless`
3411
+ # needs to have to trigger this cop
3412
+ MinBodyLength: 1
3413
+
3414
+ Style/HashAsLastArrayItem:
3415
+ Description: >-
3416
+ Checks for presence or absence of braces around hash literal as a last
3417
+ array item depending on configuration.
3418
+ StyleGuide: '#hash-literal-as-last-array-item'
3419
+ Enabled: true
3420
+ VersionAdded: '0.88'
3421
+ EnforcedStyle: braces
3422
+ SupportedStyles:
3423
+ - braces
3424
+ - no_braces
3425
+
3426
+ Style/HashEachMethods:
3427
+ Description: 'Use Hash#each_key and Hash#each_value.'
3428
+ StyleGuide: '#hash-each'
3429
+ Enabled: true
3430
+ VersionAdded: '0.80'
3431
+ Safe: false
3432
+
3433
+ Style/HashExcept:
3434
+ Description: >-
3435
+ Checks for usages of `Hash#reject`, `Hash#select`, and `Hash#filter` methods
3436
+ that can be replaced with `Hash#except` method.
3437
+ Enabled: pending
3438
+ VersionAdded: '1.7'
3439
+
3440
+ Style/HashLikeCase:
3441
+ Description: >-
3442
+ Checks for places where `case-when` represents a simple 1:1
3443
+ mapping and can be replaced with a hash lookup.
3444
+ Enabled: true
3445
+ VersionAdded: '0.88'
3446
+ # `MinBranchesCount` defines the number of branches `case` needs to have
3447
+ # to trigger this cop
3448
+ MinBranchesCount: 3
3449
+
3450
+ Style/HashSyntax:
3451
+ Description: >-
3452
+ Prefer Ruby 1.9 hash syntax { a: 1, b: 2 } over 1.8 syntax
3453
+ { :a => 1, :b => 2 }.
3454
+ StyleGuide: '#hash-literals'
3455
+ Enabled: true
3456
+ VersionAdded: '0.9'
3457
+ VersionChanged: '0.43'
3458
+ EnforcedStyle: ruby19
3459
+ SupportedStyles:
3460
+ # checks for 1.9 syntax (e.g. {a: 1}) for all symbol keys
3461
+ - ruby19
3462
+ # checks for hash rocket syntax for all hashes
3463
+ - hash_rockets
3464
+ # forbids mixed key syntaxes (e.g. {a: 1, :b => 2})
3465
+ - no_mixed_keys
3466
+ # enforces both ruby19 and no_mixed_keys styles
3467
+ - ruby19_no_mixed_keys
3468
+ # Force hashes that have a symbol value to use hash rockets
3469
+ UseHashRocketsWithSymbolValues: false
3470
+ # Do not suggest { a?: 1 } over { :a? => 1 } in ruby19 style
3471
+ PreferHashRocketsForNonAlnumEndingSymbols: false
3472
+
3473
+ Style/HashTransformKeys:
3474
+ Description: 'Prefer `transform_keys` over `each_with_object`, `map`, or `to_h`.'
3475
+ Enabled: true
3476
+ VersionAdded: '0.80'
3477
+ VersionChanged: '0.90'
3478
+ Safe: false
3479
+
3480
+ Style/HashTransformValues:
3481
+ Description: 'Prefer `transform_values` over `each_with_object`, `map`, or `to_h`.'
3482
+ Enabled: true
3483
+ VersionAdded: '0.80'
3484
+ VersionChanged: '0.90'
3485
+ Safe: false
3486
+
3487
+ Style/IdenticalConditionalBranches:
3488
+ Description: >-
3489
+ Checks that conditional statements do not have an identical
3490
+ line at the end of each branch, which can validly be moved
3491
+ out of the conditional.
3492
+ Enabled: true
3493
+ VersionAdded: '0.36'
3494
+
3495
+ Style/IfInsideElse:
3496
+ Description: 'Finds if nodes inside else, which can be converted to elsif.'
3497
+ Enabled: true
3498
+ AllowIfModifier: false
3499
+ VersionAdded: '0.36'
3500
+ VersionChanged: '1.3'
3501
+
3502
+ Style/IfUnlessModifier:
3503
+ Description: >-
3504
+ Favor modifier if/unless usage when you have a
3505
+ single-line body.
3506
+ StyleGuide: '#if-as-a-modifier'
3507
+ Enabled: true
3508
+ VersionAdded: '0.9'
3509
+ VersionChanged: '0.30'
3510
+
3511
+ Style/IfUnlessModifierOfIfUnless:
3512
+ Description: >-
3513
+ Avoid modifier if/unless usage on conditionals.
3514
+ Enabled: true
3515
+ VersionAdded: '0.39'
3516
+ VersionChanged: '0.87'
3517
+
3518
+ Style/IfWithBooleanLiteralBranches:
3519
+ Description: 'Checks for redundant `if` with boolean literal branches.'
3520
+ Enabled: pending
3521
+ VersionAdded: '1.9'
3522
+ SafeAutoCorrect: false
3523
+ AllowedMethods:
3524
+ - nonzero?
3525
+
3526
+ Style/IfWithSemicolon:
3527
+ Description: 'Do not use if x; .... Use the ternary operator instead.'
3528
+ StyleGuide: '#no-semicolon-ifs'
3529
+ Enabled: true
3530
+ VersionAdded: '0.9'
3531
+ VersionChanged: '0.83'
3532
+
3533
+ Style/ImplicitRuntimeError:
3534
+ Description: >-
3535
+ Use `raise` or `fail` with an explicit exception class and
3536
+ message, rather than just a message.
3537
+ Enabled: false
3538
+ VersionAdded: '0.41'
3539
+
3540
+ Style/InfiniteLoop:
3541
+ Description: >-
3542
+ Use Kernel#loop for infinite loops.
3543
+ This cop is unsafe in the body may raise a `StopIteration` exception.
3544
+ Safe: false
3545
+ StyleGuide: '#infinite-loop'
3546
+ Enabled: true
3547
+ VersionAdded: '0.26'
3548
+ VersionChanged: '0.61'
3549
+
3550
+ Style/InlineComment:
3551
+ Description: 'Avoid trailing inline comments.'
3552
+ Enabled: false
3553
+ VersionAdded: '0.23'
3554
+
3555
+ Style/InverseMethods:
3556
+ Description: >-
3557
+ Use the inverse method instead of `!.method`
3558
+ if an inverse method is defined.
3559
+ Enabled: true
3560
+ Safe: false
3561
+ VersionAdded: '0.48'
3562
+ # `InverseMethods` are methods that can be inverted by a not (`not` or `!`)
3563
+ # The relationship of inverse methods only needs to be defined in one direction.
3564
+ # Keys and values both need to be defined as symbols.
3565
+ InverseMethods:
3566
+ :any?: :none?
3567
+ :even?: :odd?
3568
+ :==: :!=
3569
+ :=~: :!~
3570
+ :<: :>=
3571
+ :>: :<=
3572
+ # `ActiveSupport` defines some common inverse methods. They are listed below,
3573
+ # and not enabled by default.
3574
+ #:present?: :blank?,
3575
+ #:include?: :exclude?
3576
+ # `InverseBlocks` are methods that are inverted by inverting the return
3577
+ # of the block that is passed to the method
3578
+ InverseBlocks:
3579
+ :select: :reject
3580
+ :select!: :reject!
3581
+
3582
+ Style/IpAddresses:
3583
+ Description: "Don't include literal IP addresses in code."
3584
+ Enabled: false
3585
+ VersionAdded: '0.58'
3586
+ VersionChanged: '0.91'
3587
+ # Allow addresses to be permitted
3588
+ AllowedAddresses:
3589
+ - "::"
3590
+ # :: is a valid IPv6 address, but could potentially be legitimately in code
3591
+ Exclude:
3592
+ - '**/*.gemfile'
3593
+ - '**/Gemfile'
3594
+ - '**/gems.rb'
3595
+ - '**/*.gemspec'
3596
+
3597
+ Style/KeywordParametersOrder:
3598
+ Description: 'Enforces that optional keyword parameters are placed at the end of the parameters list.'
3599
+ StyleGuide: '#keyword-parameters-order'
3600
+ Enabled: true
3601
+ VersionAdded: '0.90'
3602
+ VersionChanged: '1.7'
3603
+
3604
+ Style/Lambda:
3605
+ Description: 'Use the new lambda literal syntax for single-line blocks.'
3606
+ StyleGuide: '#lambda-multi-line'
3607
+ Enabled: true
3608
+ VersionAdded: '0.9'
3609
+ VersionChanged: '0.40'
3610
+ EnforcedStyle: line_count_dependent
3611
+ SupportedStyles:
3612
+ - line_count_dependent
3613
+ - lambda
3614
+ - literal
3615
+
3616
+ Style/LambdaCall:
3617
+ Description: 'Use lambda.call(...) instead of lambda.(...).'
3618
+ StyleGuide: '#proc-call'
3619
+ Enabled: true
3620
+ VersionAdded: '0.13'
3621
+ VersionChanged: '0.14'
3622
+ EnforcedStyle: call
3623
+ SupportedStyles:
3624
+ - call
3625
+ - braces
3626
+
3627
+ Style/LineEndConcatenation:
3628
+ Description: >-
3629
+ Use \ instead of + or << to concatenate two string literals at
3630
+ line end.
3631
+ Enabled: true
3632
+ SafeAutoCorrect: false
3633
+ VersionAdded: '0.18'
3634
+ VersionChanged: '0.64'
3635
+
3636
+ Style/MethodCallWithArgsParentheses:
3637
+ Description: 'Use parentheses for method calls with arguments.'
3638
+ StyleGuide: '#method-invocation-parens'
3639
+ Enabled: false
3640
+ VersionAdded: '0.47'
3641
+ VersionChanged: '1.7'
3642
+ IgnoreMacros: true
3643
+ IgnoredMethods: []
3644
+ IgnoredPatterns: []
3645
+ IncludedMacros: []
3646
+ AllowParenthesesInMultilineCall: false
3647
+ AllowParenthesesInChaining: false
3648
+ AllowParenthesesInCamelCaseMethod: false
3649
+ EnforcedStyle: require_parentheses
3650
+ SupportedStyles:
3651
+ - require_parentheses
3652
+ - omit_parentheses
3653
+
3654
+ Style/MethodCallWithoutArgsParentheses:
3655
+ Description: 'Do not use parentheses for method calls with no arguments.'
3656
+ StyleGuide: '#method-invocation-parens'
3657
+ Enabled: true
3658
+ IgnoredMethods: []
3659
+ VersionAdded: '0.47'
3660
+ VersionChanged: '0.55'
3661
+
3662
+ Style/MethodCalledOnDoEndBlock:
3663
+ Description: 'Avoid chaining a method call on a do...end block.'
3664
+ StyleGuide: '#single-line-blocks'
3665
+ Enabled: false
3666
+ VersionAdded: '0.14'
3667
+
3668
+ Style/MethodDefParentheses:
3669
+ Description: >-
3670
+ Checks if the method definitions have or don't have
3671
+ parentheses.
3672
+ StyleGuide: '#method-parens'
3673
+ Enabled: true
3674
+ VersionAdded: '0.16'
3675
+ VersionChanged: '1.7'
3676
+ EnforcedStyle: require_parentheses
3677
+ SupportedStyles:
3678
+ - require_parentheses
3679
+ - require_no_parentheses
3680
+ - require_no_parentheses_except_multiline
3681
+
3682
+ Style/MinMax:
3683
+ Description: >-
3684
+ Use `Enumerable#minmax` instead of `Enumerable#min`
3685
+ and `Enumerable#max` in conjunction.
3686
+ Enabled: true
3687
+ VersionAdded: '0.50'
3688
+
3689
+ Style/MissingElse:
3690
+ Description: >-
3691
+ Require if/case expressions to have an else branches.
3692
+ If enabled, it is recommended that
3693
+ Style/UnlessElse and Style/EmptyElse be enabled.
3694
+ This will conflict with Style/EmptyElse if
3695
+ Style/EmptyElse is configured to style "both".
3696
+ Enabled: false
3697
+ VersionAdded: '0.30'
3698
+ VersionChanged: '0.38'
3699
+ EnforcedStyle: both
3700
+ SupportedStyles:
3701
+ # if - warn when an if expression is missing an else branch
3702
+ # case - warn when a case expression is missing an else branch
3703
+ # both - warn when an if or case expression is missing an else branch
3704
+ - if
3705
+ - case
3706
+ - both
3707
+
3708
+ Style/MissingRespondToMissing:
3709
+ Description: >-
3710
+ Checks if `method_missing` is implemented
3711
+ without implementing `respond_to_missing`.
3712
+ StyleGuide: '#no-method-missing'
3713
+ Enabled: true
3714
+ VersionAdded: '0.56'
3715
+
3716
+ Style/MixinGrouping:
3717
+ Description: 'Checks for grouping of mixins in `class` and `module` bodies.'
3718
+ StyleGuide: '#mixin-grouping'
3719
+ Enabled: true
3720
+ VersionAdded: '0.48'
3721
+ VersionChanged: '0.49'
3722
+ EnforcedStyle: separated
3723
+ SupportedStyles:
3724
+ # separated: each mixed in module goes in a separate statement.
3725
+ # grouped: mixed in modules are grouped into a single statement.
3726
+ - separated
3727
+ - grouped
3728
+
3729
+ Style/MixinUsage:
3730
+ Description: 'Checks that `include`, `extend` and `prepend` exists at the top level.'
3731
+ Enabled: true
3732
+ VersionAdded: '0.51'
3733
+
3734
+ Style/ModuleFunction:
3735
+ Description: 'Checks for usage of `extend self` in modules.'
3736
+ StyleGuide: '#module-function'
3737
+ Enabled: true
3738
+ VersionAdded: '0.11'
3739
+ VersionChanged: '0.65'
3740
+ EnforcedStyle: module_function
3741
+ SupportedStyles:
3742
+ - module_function
3743
+ - extend_self
3744
+ - forbidden
3745
+ Autocorrect: false
3746
+ SafeAutoCorrect: false
3747
+
3748
+ Style/MultilineBlockChain:
3749
+ Description: 'Avoid multi-line chains of blocks.'
3750
+ StyleGuide: '#single-line-blocks'
3751
+ Enabled: true
3752
+ VersionAdded: '0.13'
3753
+
3754
+ Style/MultilineIfModifier:
3755
+ Description: 'Only use if/unless modifiers on single line statements.'
3756
+ StyleGuide: '#no-multiline-if-modifiers'
3757
+ Enabled: true
3758
+ VersionAdded: '0.45'
3759
+
3760
+ Style/MultilineIfThen:
3761
+ Description: 'Do not use then for multi-line if/unless.'
3762
+ StyleGuide: '#no-then'
3763
+ Enabled: true
3764
+ VersionAdded: '0.9'
3765
+ VersionChanged: '0.26'
3766
+
3767
+ Style/MultilineMemoization:
3768
+ Description: 'Wrap multiline memoizations in a `begin` and `end` block.'
3769
+ Enabled: true
3770
+ VersionAdded: '0.44'
3771
+ VersionChanged: '0.48'
3772
+ EnforcedStyle: keyword
3773
+ SupportedStyles:
3774
+ - keyword
3775
+ - braces
3776
+
3777
+ Style/MultilineMethodSignature:
3778
+ Description: 'Avoid multi-line method signatures.'
3779
+ Enabled: false
3780
+ VersionAdded: '0.59'
3781
+ VersionChanged: '1.7'
3782
+
3783
+ Style/MultilineTernaryOperator:
3784
+ Description: >-
3785
+ Avoid multi-line ?: (the ternary operator);
3786
+ use if/unless instead.
3787
+ StyleGuide: '#no-multiline-ternary'
3788
+ Enabled: true
3789
+ VersionAdded: '0.9'
3790
+ VersionChanged: '0.86'
3791
+
3792
+ Style/MultilineWhenThen:
3793
+ Description: 'Do not use then for multi-line when statement.'
3794
+ StyleGuide: '#no-then'
3795
+ Enabled: true
3796
+ VersionAdded: '0.73'
3797
+
3798
+ Style/MultipleComparison:
3799
+ Description: >-
3800
+ Avoid comparing a variable with multiple items in a conditional,
3801
+ use Array#include? instead.
3802
+ Enabled: true
3803
+ VersionAdded: '0.49'
3804
+ VersionChanged: '1.1'
3805
+
3806
+ Style/MutableConstant:
3807
+ Description: 'Do not assign mutable objects to constants.'
3808
+ Enabled: true
3809
+ VersionAdded: '0.34'
3810
+ VersionChanged: '1.8'
3811
+ SafeAutoCorrect: false
3812
+ EnforcedStyle: literals
3813
+ SupportedStyles:
3814
+ # literals: freeze literals assigned to constants
3815
+ # strict: freeze all constants
3816
+ # Strict mode is considered an experimental feature. It has not been updated
3817
+ # with an exhaustive list of all methods that will produce frozen objects so
3818
+ # there is a decent chance of getting some false positives. Luckily, there is
3819
+ # no harm in freezing an already frozen object.
3820
+ - literals
3821
+ - strict
3822
+
3823
+ Style/NegatedIf:
3824
+ Description: >-
3825
+ Favor unless over if for negative conditions
3826
+ (or control flow or).
3827
+ StyleGuide: '#unless-for-negatives'
3828
+ Enabled: true
3829
+ VersionAdded: '0.20'
3830
+ VersionChanged: '0.48'
3831
+ EnforcedStyle: both
3832
+ SupportedStyles:
3833
+ # both: prefix and postfix negated `if` should both use `unless`
3834
+ # prefix: only use `unless` for negated `if` statements positioned before the body of the statement
3835
+ # postfix: only use `unless` for negated `if` statements positioned after the body of the statement
3836
+ - both
3837
+ - prefix
3838
+ - postfix
3839
+
3840
+ Style/NegatedIfElseCondition:
3841
+ Description: >-
3842
+ This cop checks for uses of `if-else` and ternary operators with a negated condition
3843
+ which can be simplified by inverting condition and swapping branches.
3844
+ Enabled: pending
3845
+ VersionAdded: '1.2'
3846
+
3847
+ Style/NegatedUnless:
3848
+ Description: 'Favor if over unless for negative conditions.'
3849
+ StyleGuide: '#if-for-negatives'
3850
+ Enabled: true
3851
+ VersionAdded: '0.69'
3852
+ EnforcedStyle: both
3853
+ SupportedStyles:
3854
+ # both: prefix and postfix negated `unless` should both use `if`
3855
+ # prefix: only use `if` for negated `unless` statements positioned before the body of the statement
3856
+ # postfix: only use `if` for negated `unless` statements positioned after the body of the statement
3857
+ - both
3858
+ - prefix
3859
+ - postfix
3860
+
3861
+ Style/NegatedWhile:
3862
+ Description: 'Favor until over while for negative conditions.'
3863
+ StyleGuide: '#until-for-negatives'
3864
+ Enabled: true
3865
+ VersionAdded: '0.20'
3866
+
3867
+ Style/NestedModifier:
3868
+ Description: 'Avoid using nested modifiers.'
3869
+ StyleGuide: '#no-nested-modifiers'
3870
+ Enabled: true
3871
+ VersionAdded: '0.35'
3872
+
3873
+ Style/NestedParenthesizedCalls:
3874
+ Description: >-
3875
+ Parenthesize method calls which are nested inside the
3876
+ argument list of another parenthesized method call.
3877
+ Enabled: true
3878
+ VersionAdded: '0.36'
3879
+ VersionChanged: '0.77'
3880
+ AllowedMethods:
3881
+ - be
3882
+ - be_a
3883
+ - be_an
3884
+ - be_between
3885
+ - be_falsey
3886
+ - be_kind_of
3887
+ - be_instance_of
3888
+ - be_truthy
3889
+ - be_within
3890
+ - eq
3891
+ - eql
3892
+ - end_with
3893
+ - include
3894
+ - match
3895
+ - raise_error
3896
+ - respond_to
3897
+ - start_with
3898
+
3899
+ Style/NestedTernaryOperator:
3900
+ Description: 'Use one expression per branch in a ternary operator.'
3901
+ StyleGuide: '#no-nested-ternary'
3902
+ Enabled: true
3903
+ VersionAdded: '0.9'
3904
+ VersionChanged: '0.86'
3905
+
3906
+ Style/Next:
3907
+ Description: 'Use `next` to skip iteration instead of a condition at the end.'
3908
+ StyleGuide: '#no-nested-conditionals'
3909
+ Enabled: true
3910
+ VersionAdded: '0.22'
3911
+ VersionChanged: '0.35'
3912
+ # With `always` all conditions at the end of an iteration needs to be
3913
+ # replaced by next - with `skip_modifier_ifs` the modifier if like this one
3914
+ # are ignored: [1, 2].each { |a| return 'yes' if a == 1 }
3915
+ EnforcedStyle: skip_modifier_ifs
3916
+ # `MinBodyLength` defines the number of lines of the a body of an `if` or `unless`
3917
+ # needs to have to trigger this cop
3918
+ MinBodyLength: 3
3919
+ SupportedStyles:
3920
+ - skip_modifier_ifs
3921
+ - always
3922
+
3923
+ Style/NilComparison:
3924
+ Description: 'Prefer x.nil? to x == nil.'
3925
+ StyleGuide: '#predicate-methods'
3926
+ Enabled: true
3927
+ VersionAdded: '0.12'
3928
+ VersionChanged: '0.59'
3929
+ EnforcedStyle: predicate
3930
+ SupportedStyles:
3931
+ - predicate
3932
+ - comparison
3933
+
3934
+ Style/NilLambda:
3935
+ Description: 'Prefer `-> {}` to `-> { nil }`.'
3936
+ Enabled: pending
3937
+ VersionAdded: '1.3'
3938
+
3939
+ Style/NonNilCheck:
3940
+ Description: 'Checks for redundant nil checks.'
3941
+ StyleGuide: '#no-non-nil-checks'
3942
+ Enabled: true
3943
+ VersionAdded: '0.20'
3944
+ VersionChanged: '0.22'
3945
+ # With `IncludeSemanticChanges` set to `true`, this cop reports offenses for
3946
+ # `!x.nil?` and autocorrects that and `x != nil` to solely `x`, which is
3947
+ # **usually** OK, but might change behavior.
3948
+ #
3949
+ # With `IncludeSemanticChanges` set to `false`, this cop does not report
3950
+ # offenses for `!x.nil?` and does no changes that might change behavior.
3951
+ IncludeSemanticChanges: false
3952
+
3953
+ Style/Not:
3954
+ Description: 'Use ! instead of not.'
3955
+ StyleGuide: '#bang-not-not'
3956
+ Enabled: true
3957
+ VersionAdded: '0.9'
3958
+ VersionChanged: '0.20'
3959
+
3960
+ Style/NumericLiteralPrefix:
3961
+ Description: 'Use smallcase prefixes for numeric literals.'
3962
+ StyleGuide: '#numeric-literal-prefixes'
3963
+ Enabled: true
3964
+ VersionAdded: '0.41'
3965
+ EnforcedOctalStyle: zero_with_o
3966
+ SupportedOctalStyles:
3967
+ - zero_with_o
3968
+ - zero_only
3969
+
3970
+
3971
+ Style/NumericLiterals:
3972
+ Description: >-
3973
+ Add underscores to large numeric literals to improve their
3974
+ readability.
3975
+ StyleGuide: '#underscores-in-numerics'
3976
+ Enabled: true
3977
+ VersionAdded: '0.9'
3978
+ VersionChanged: '0.48'
3979
+ MinDigits: 5
3980
+ Strict: false
3981
+
3982
+ Style/NumericPredicate:
3983
+ Description: >-
3984
+ Checks for the use of predicate- or comparison methods for
3985
+ numeric comparisons.
3986
+ StyleGuide: '#predicate-methods'
3987
+ Safe: false
3988
+ # This will change to a new method call which isn't guaranteed to be on the
3989
+ # object. Switching these methods has to be done with knowledge of the types
3990
+ # of the variables which rubocop doesn't have.
3991
+ SafeAutoCorrect: false
3992
+ Enabled: true
3993
+ VersionAdded: '0.42'
3994
+ VersionChanged: '0.59'
3995
+ EnforcedStyle: predicate
3996
+ SupportedStyles:
3997
+ - predicate
3998
+ - comparison
3999
+ IgnoredMethods: []
4000
+ # Exclude RSpec specs because assertions like `expect(1).to be > 0` cause
4001
+ # false positives.
4002
+ Exclude:
4003
+ - 'spec/**/*'
4004
+
4005
+ Style/OneLineConditional:
4006
+ Description: >-
4007
+ Favor the ternary operator (?:) or multi-line constructs over
4008
+ single-line if/then/else/end constructs.
4009
+ StyleGuide: '#ternary-operator'
4010
+ Enabled: true
4011
+ AlwaysCorrectToMultiline: false
4012
+ VersionAdded: '0.9'
4013
+ VersionChanged: '0.90'
4014
+
4015
+ Style/OptionHash:
4016
+ Description: "Don't use option hashes when you can use keyword arguments."
4017
+ Enabled: false
4018
+ VersionAdded: '0.33'
4019
+ VersionChanged: '0.34'
4020
+ # A list of parameter names that will be flagged by this cop.
4021
+ SuspiciousParamNames:
4022
+ - options
4023
+ - opts
4024
+ - args
4025
+ - params
4026
+ - parameters
4027
+
4028
+ Style/OptionalArguments:
4029
+ Description: >-
4030
+ Checks for optional arguments that do not appear at the end
4031
+ of the argument list.
4032
+ StyleGuide: '#optional-arguments'
4033
+ Enabled: true
4034
+ Safe: false
4035
+ VersionAdded: '0.33'
4036
+ VersionChanged: '0.83'
4037
+
4038
+ Style/OptionalBooleanParameter:
4039
+ Description: 'Use keyword arguments when defining method with boolean argument.'
4040
+ StyleGuide: '#boolean-keyword-arguments'
4041
+ Enabled: true
4042
+ Safe: false
4043
+ VersionAdded: '0.89'
4044
+ AllowedMethods:
4045
+ - respond_to_missing?
4046
+
4047
+ Style/OrAssignment:
4048
+ Description: 'Recommend usage of double pipe equals (||=) where applicable.'
4049
+ StyleGuide: '#double-pipe-for-uninit'
4050
+ Enabled: true
4051
+ VersionAdded: '0.50'
4052
+
4053
+ Style/ParallelAssignment:
4054
+ Description: >-
4055
+ Check for simple usages of parallel assignment.
4056
+ It will only warn when the number of variables
4057
+ matches on both sides of the assignment.
4058
+ StyleGuide: '#parallel-assignment'
4059
+ Enabled: true
4060
+ VersionAdded: '0.32'
4061
+
4062
+ Style/ParenthesesAroundCondition:
4063
+ Description: >-
4064
+ Don't use parentheses around the condition of an
4065
+ if/unless/while.
4066
+ StyleGuide: '#no-parens-around-condition'
4067
+ Enabled: true
4068
+ VersionAdded: '0.9'
4069
+ VersionChanged: '0.56'
4070
+ AllowSafeAssignment: true
4071
+ AllowInMultilineConditions: false
4072
+
4073
+ Style/PercentLiteralDelimiters:
4074
+ Description: 'Use `%`-literal delimiters consistently.'
4075
+ StyleGuide: '#percent-literal-braces'
4076
+ Enabled: true
4077
+ VersionAdded: '0.19'
4078
+ # Specify the default preferred delimiter for all types with the 'default' key
4079
+ # Override individual delimiters (even with default specified) by specifying
4080
+ # an individual key
4081
+ PreferredDelimiters:
4082
+ default: ()
4083
+ '%i': '[]'
4084
+ '%I': '[]'
4085
+ '%r': '{}'
4086
+ '%w': '[]'
4087
+ '%W': '[]'
4088
+ VersionChanged: '0.48'
4089
+
4090
+ Style/PercentQLiterals:
4091
+ Description: 'Checks if uses of %Q/%q match the configured preference.'
4092
+ Enabled: true
4093
+ VersionAdded: '0.25'
4094
+ EnforcedStyle: lower_case_q
4095
+ SupportedStyles:
4096
+ - lower_case_q # Use `%q` when possible, `%Q` when necessary
4097
+ - upper_case_q # Always use `%Q`
4098
+
4099
+ Style/PerlBackrefs:
4100
+ Description: 'Avoid Perl-style regex back references.'
4101
+ StyleGuide: '#no-perl-regexp-last-matchers'
4102
+ Enabled: true
4103
+ VersionAdded: '0.13'
4104
+
4105
+ Style/PreferredHashMethods:
4106
+ Description: 'Checks use of `has_key?` and `has_value?` Hash methods.'
4107
+ StyleGuide: '#hash-key'
4108
+ Enabled: true
4109
+ Safe: false
4110
+ VersionAdded: '0.41'
4111
+ VersionChanged: '0.70'
4112
+ EnforcedStyle: short
4113
+ SupportedStyles:
4114
+ - short
4115
+ - verbose
4116
+
4117
+ Style/Proc:
4118
+ Description: 'Use proc instead of Proc.new.'
4119
+ StyleGuide: '#proc'
4120
+ Enabled: true
4121
+ VersionAdded: '0.9'
4122
+ VersionChanged: '0.18'
4123
+
4124
+ Style/RaiseArgs:
4125
+ Description: 'Checks the arguments passed to raise/fail.'
4126
+ StyleGuide: '#exception-class-messages'
4127
+ Enabled: true
4128
+ VersionAdded: '0.14'
4129
+ VersionChanged: '1.2'
4130
+ EnforcedStyle: exploded
4131
+ SupportedStyles:
4132
+ - compact # raise Exception.new(msg)
4133
+ - exploded # raise Exception, msg
4134
+ AllowedCompactTypes: []
4135
+
4136
+ Style/RandomWithOffset:
4137
+ Description: >-
4138
+ Prefer to use ranges when generating random numbers instead of
4139
+ integers with offsets.
4140
+ StyleGuide: '#random-numbers'
4141
+ Enabled: true
4142
+ VersionAdded: '0.52'
4143
+
4144
+ Style/RedundantArgument:
4145
+ Description: 'Check for a redundant argument passed to certain methods.'
4146
+ Enabled: pending
4147
+ Safe: false
4148
+ VersionAdded: '1.4'
4149
+ VersionChanged: '1.7'
4150
+ Methods:
4151
+ # Array#join
4152
+ join: ''
4153
+ # String#split
4154
+ split: ' '
4155
+ # String#chomp
4156
+ chomp: "\n"
4157
+ # String#chomp!
4158
+ chomp!: "\n"
4159
+
4160
+ Style/RedundantAssignment:
4161
+ Description: 'Checks for redundant assignment before returning.'
4162
+ Enabled: true
4163
+ VersionAdded: '0.87'
4164
+
4165
+ Style/RedundantBegin:
4166
+ Description: "Don't use begin blocks when they are not needed."
4167
+ StyleGuide: '#begin-implicit'
4168
+ Enabled: true
4169
+ VersionAdded: '0.10'
4170
+ VersionChanged: '0.21'
4171
+
4172
+ Style/RedundantCapitalW:
4173
+ Description: 'Checks for %W when interpolation is not needed.'
4174
+ Enabled: true
4175
+ VersionAdded: '0.76'
4176
+
4177
+ Style/RedundantCondition:
4178
+ Description: 'Checks for unnecessary conditional expressions.'
4179
+ Enabled: true
4180
+ VersionAdded: '0.76'
4181
+
4182
+ Style/RedundantConditional:
4183
+ Description: "Don't return true/false from a conditional."
4184
+ Enabled: true
4185
+ VersionAdded: '0.50'
4186
+
4187
+ Style/RedundantException:
4188
+ Description: "Checks for an obsolete RuntimeException argument in raise/fail."
4189
+ StyleGuide: '#no-explicit-runtimeerror'
4190
+ Enabled: true
4191
+ VersionAdded: '0.14'
4192
+ VersionChanged: '0.29'
4193
+
4194
+ Style/RedundantFetchBlock:
4195
+ Description: >-
4196
+ Use `fetch(key, value)` instead of `fetch(key) { value }`
4197
+ when value has Numeric, Rational, Complex, Symbol or String type, `false`, `true`, `nil` or is a constant.
4198
+ Reference: 'https://github.com/JuanitoFatas/fast-ruby#hashfetch-with-argument-vs-hashfetch--block-code'
4199
+ Enabled: true
4200
+ Safe: false
4201
+ # If enabled, this cop will autocorrect usages of
4202
+ # `fetch` being called with block returning a constant.
4203
+ # This can be dangerous since constants will not be defined at that moment.
4204
+ SafeForConstants: false
4205
+ VersionAdded: '0.86'
4206
+
4207
+ Style/RedundantFileExtensionInRequire:
4208
+ Description: >-
4209
+ Checks for the presence of superfluous `.rb` extension in
4210
+ the filename provided to `require` and `require_relative`.
4211
+ StyleGuide: '#no-explicit-rb-to-require'
4212
+ Enabled: true
4213
+ VersionAdded: '0.88'
4214
+
4215
+ Style/RedundantFreeze:
4216
+ Description: "Checks usages of Object#freeze on immutable objects."
4217
+ Enabled: true
4218
+ VersionAdded: '0.34'
4219
+ VersionChanged: '0.66'
4220
+
4221
+ Style/RedundantInterpolation:
4222
+ Description: 'Checks for strings that are just an interpolated expression.'
4223
+ Enabled: true
4224
+ VersionAdded: '0.76'
4225
+
4226
+ Style/RedundantParentheses:
4227
+ Description: "Checks for parentheses that seem not to serve any purpose."
4228
+ Enabled: true
4229
+ VersionAdded: '0.36'
4230
+
4231
+ Style/RedundantPercentQ:
4232
+ Description: 'Checks for %q/%Q when single quotes or double quotes would do.'
4233
+ StyleGuide: '#percent-q'
4234
+ Enabled: true
4235
+ VersionAdded: '0.76'
4236
+
4237
+ Style/RedundantRegexpCharacterClass:
4238
+ Description: 'Checks for unnecessary single-element Regexp character classes.'
4239
+ Enabled: true
4240
+ VersionAdded: '0.85'
4241
+
4242
+ Style/RedundantRegexpEscape:
4243
+ Description: 'Checks for redundant escapes in Regexps.'
4244
+ Enabled: true
4245
+ VersionAdded: '0.85'
4246
+
4247
+ Style/RedundantReturn:
4248
+ Description: "Don't use return where it's not required."
4249
+ StyleGuide: '#no-explicit-return'
4250
+ Enabled: true
4251
+ VersionAdded: '0.10'
4252
+ VersionChanged: '0.14'
4253
+ # When `true` allows code like `return x, y`.
4254
+ AllowMultipleReturnValues: false
4255
+
4256
+ Style/RedundantSelf:
4257
+ Description: "Don't use self where it's not needed."
4258
+ StyleGuide: '#no-self-unless-required'
4259
+ Enabled: true
4260
+ VersionAdded: '0.10'
4261
+ VersionChanged: '0.13'
4262
+
4263
+ Style/RedundantSelfAssignment:
4264
+ Description: 'Checks for places where redundant assignments are made for in place modification methods.'
4265
+ Enabled: true
4266
+ Safe: false
4267
+ VersionAdded: '0.90'
4268
+
4269
+ Style/RedundantSort:
4270
+ Description: >-
4271
+ Use `min` instead of `sort.first`,
4272
+ `max_by` instead of `sort_by...last`, etc.
4273
+ Enabled: true
4274
+ VersionAdded: '0.76'
4275
+
4276
+ Style/RedundantSortBy:
4277
+ Description: 'Use `sort` instead of `sort_by { |x| x }`.'
4278
+ Enabled: true
4279
+ VersionAdded: '0.36'
4280
+
4281
+ Style/RegexpLiteral:
4282
+ Description: 'Use / or %r around regular expressions.'
4283
+ StyleGuide: '#percent-r'
4284
+ Enabled: true
4285
+ VersionAdded: '0.9'
4286
+ VersionChanged: '0.30'
4287
+ EnforcedStyle: slashes
4288
+ # slashes: Always use slashes.
4289
+ # percent_r: Always use `%r`.
4290
+ # mixed: Use slashes on single-line regexes, and `%r` on multi-line regexes.
4291
+ SupportedStyles:
4292
+ - slashes
4293
+ - percent_r
4294
+ - mixed
4295
+ # If `false`, the cop will always recommend using `%r` if one or more slashes
4296
+ # are found in the regexp string.
4297
+ AllowInnerSlashes: false
4298
+
4299
+ Style/RescueModifier:
4300
+ Description: 'Avoid using rescue in its modifier form.'
4301
+ StyleGuide: '#no-rescue-modifiers'
4302
+ Enabled: true
4303
+ VersionAdded: '0.9'
4304
+ VersionChanged: '0.34'
4305
+
4306
+ Style/RescueStandardError:
4307
+ Description: 'Avoid rescuing without specifying an error class.'
4308
+ Enabled: true
4309
+ VersionAdded: '0.52'
4310
+ EnforcedStyle: explicit
4311
+ # implicit: Do not include the error class, `rescue`
4312
+ # explicit: Require an error class `rescue StandardError`
4313
+ SupportedStyles:
4314
+ - implicit
4315
+ - explicit
4316
+
4317
+ Style/ReturnNil:
4318
+ Description: 'Use return instead of return nil.'
4319
+ Enabled: false
4320
+ EnforcedStyle: return
4321
+ SupportedStyles:
4322
+ - return
4323
+ - return_nil
4324
+ VersionAdded: '0.50'
4325
+
4326
+ Style/SafeNavigation:
4327
+ Description: >-
4328
+ This cop transforms usages of a method call safeguarded by
4329
+ a check for the existence of the object to
4330
+ safe navigation (`&.`).
4331
+ Auto-correction is unsafe as it assumes the object will
4332
+ be `nil` or truthy, but never `false`.
4333
+ Enabled: true
4334
+ VersionAdded: '0.43'
4335
+ VersionChanged: '0.77'
4336
+ # Safe navigation may cause a statement to start returning `nil` in addition
4337
+ # to whatever it used to return.
4338
+ ConvertCodeThatCanStartToReturnNil: false
4339
+ AllowedMethods:
4340
+ - present?
4341
+ - blank?
4342
+ - presence
4343
+ - try
4344
+ - try!
4345
+ SafeAutoCorrect: false
4346
+
4347
+ Style/Sample:
4348
+ Description: >-
4349
+ Use `sample` instead of `shuffle.first`,
4350
+ `shuffle.last`, and `shuffle[Integer]`.
4351
+ Reference: 'https://github.com/JuanitoFatas/fast-ruby#arrayshufflefirst-vs-arraysample-code'
4352
+ Enabled: true
4353
+ VersionAdded: '0.30'
4354
+
4355
+ Style/SelfAssignment:
4356
+ Description: >-
4357
+ Checks for places where self-assignment shorthand should have
4358
+ been used.
4359
+ StyleGuide: '#self-assignment'
4360
+ Enabled: true
4361
+ VersionAdded: '0.19'
4362
+ VersionChanged: '0.29'
4363
+
4364
+ Style/Semicolon:
4365
+ Description: "Don't use semicolons to terminate expressions."
4366
+ StyleGuide: '#no-semicolon'
4367
+ Enabled: true
4368
+ VersionAdded: '0.9'
4369
+ VersionChanged: '0.19'
4370
+ # Allow `;` to separate several expressions on the same line.
4371
+ AllowAsExpressionSeparator: false
4372
+
4373
+ Style/Send:
4374
+ Description: 'Prefer `Object#__send__` or `Object#public_send` to `send`, as `send` may overlap with existing methods.'
4375
+ StyleGuide: '#prefer-public-send'
4376
+ Enabled: false
4377
+ VersionAdded: '0.33'
4378
+
4379
+ Style/SignalException:
4380
+ Description: 'Checks for proper usage of fail and raise.'
4381
+ StyleGuide: '#prefer-raise-over-fail'
4382
+ Enabled: true
4383
+ VersionAdded: '0.11'
4384
+ VersionChanged: '0.37'
4385
+ EnforcedStyle: only_raise
4386
+ SupportedStyles:
4387
+ - only_raise
4388
+ - only_fail
4389
+ - semantic
4390
+
4391
+ Style/SingleArgumentDig:
4392
+ Description: 'Avoid using single argument dig method.'
4393
+ Enabled: true
4394
+ VersionAdded: '0.89'
4395
+ Safe: false
4396
+
4397
+ Style/SingleLineBlockParams:
4398
+ Description: 'Enforces the names of some block params.'
4399
+ Enabled: false
4400
+ VersionAdded: '0.16'
4401
+ VersionChanged: '1.6'
4402
+ Methods:
4403
+ - reduce:
4404
+ - acc
4405
+ - elem
4406
+ - inject:
4407
+ - acc
4408
+ - elem
4409
+
4410
+ Style/SingleLineMethods:
4411
+ Description: 'Avoid single-line methods.'
4412
+ StyleGuide: '#no-single-line-methods'
4413
+ Enabled: true
4414
+ VersionAdded: '0.9'
4415
+ VersionChanged: '1.8'
4416
+ AllowIfMethodIsEmpty: true
4417
+
4418
+ Style/SlicingWithRange:
4419
+ Description: 'Checks array slicing is done with endless ranges when suitable.'
4420
+ Enabled: true
4421
+ VersionAdded: '0.83'
4422
+ Safe: false
4423
+
4424
+ Style/SoleNestedConditional:
4425
+ Description: >-
4426
+ Finds sole nested conditional nodes
4427
+ which can be merged into outer conditional node.
4428
+ Enabled: true
4429
+ VersionAdded: '0.89'
4430
+ VersionChanged: '1.5'
4431
+ AllowModifier: false
4432
+
4433
+ Style/SpecialGlobalVars:
4434
+ Description: 'Avoid Perl-style global variables.'
4435
+ StyleGuide: '#no-cryptic-perlisms'
4436
+ Enabled: true
4437
+ VersionAdded: '0.13'
4438
+ VersionChanged: '0.36'
4439
+ SafeAutoCorrect: false
4440
+ EnforcedStyle: use_english_names
4441
+ SupportedStyles:
4442
+ - use_perl_names
4443
+ - use_english_names
4444
+
4445
+ Style/StabbyLambdaParentheses:
4446
+ Description: 'Check for the usage of parentheses around stabby lambda arguments.'
4447
+ StyleGuide: '#stabby-lambda-with-args'
4448
+ Enabled: true
4449
+ VersionAdded: '0.35'
4450
+ EnforcedStyle: require_parentheses
4451
+ SupportedStyles:
4452
+ - require_parentheses
4453
+ - require_no_parentheses
4454
+
4455
+ Style/StaticClass:
4456
+ Description: 'Prefer modules to classes with only class methods.'
4457
+ StyleGuide: '#modules-vs-classes'
4458
+ Enabled: false
4459
+ Safe: false
4460
+ VersionAdded: '1.3'
4461
+
4462
+ Style/StderrPuts:
4463
+ Description: 'Use `warn` instead of `$stderr.puts`.'
4464
+ StyleGuide: '#warn'
4465
+ Enabled: true
4466
+ VersionAdded: '0.51'
4467
+
4468
+ Style/StringConcatenation:
4469
+ Description: 'Checks for places where string concatenation can be replaced with string interpolation.'
4470
+ StyleGuide: '#string-interpolation'
4471
+ Enabled: true
4472
+ Safe: false
4473
+ VersionAdded: '0.89'
4474
+ VersionChanged: '1.6'
4475
+
4476
+ Style/StringHashKeys:
4477
+ Description: 'Prefer symbols instead of strings as hash keys.'
4478
+ StyleGuide: '#symbols-as-keys'
4479
+ Enabled: false
4480
+ VersionAdded: '0.52'
4481
+ VersionChanged: '0.75'
4482
+ Safe: false
4483
+
4484
+ Style/StringLiterals:
4485
+ Description: 'Checks if uses of quotes match the configured preference.'
4486
+ StyleGuide: '#consistent-string-literals'
4487
+ Enabled: true
4488
+ VersionAdded: '0.9'
4489
+ VersionChanged: '0.36'
4490
+ EnforcedStyle: single_quotes
4491
+ SupportedStyles:
4492
+ - single_quotes
4493
+ - double_quotes
4494
+ # If `true`, strings which span multiple lines using `\` for continuation must
4495
+ # use the same type of quotes on each line.
4496
+ ConsistentQuotesInMultiline: false
4497
+
4498
+ Style/StringLiteralsInInterpolation:
4499
+ Description: >-
4500
+ Checks if uses of quotes inside expressions in interpolated
4501
+ strings match the configured preference.
4502
+ Enabled: true
4503
+ VersionAdded: '0.27'
4504
+ EnforcedStyle: single_quotes
4505
+ SupportedStyles:
4506
+ - single_quotes
4507
+ - double_quotes
4508
+
4509
+ Style/StringMethods:
4510
+ Description: 'Checks if configured preferred methods are used over non-preferred.'
4511
+ Enabled: false
4512
+ VersionAdded: '0.34'
4513
+ VersionChanged: '0.34'
4514
+ # Mapping from undesired method to desired_method
4515
+ # e.g. to use `to_sym` over `intern`:
4516
+ #
4517
+ # StringMethods:
4518
+ # PreferredMethods:
4519
+ # intern: to_sym
4520
+ PreferredMethods:
4521
+ intern: to_sym
4522
+
4523
+ Style/Strip:
4524
+ Description: 'Use `strip` instead of `lstrip.rstrip`.'
4525
+ Enabled: true
4526
+ VersionAdded: '0.36'
4527
+
4528
+ Style/StructInheritance:
4529
+ Description: 'Checks for inheritance from Struct.new.'
4530
+ StyleGuide: '#no-extend-struct-new'
4531
+ Enabled: true
4532
+ VersionAdded: '0.29'
4533
+ VersionChanged: '0.86'
4534
+
4535
+ Style/SwapValues:
4536
+ Description: 'This cop enforces the use of shorthand-style swapping of 2 variables.'
4537
+ StyleGuide: '#values-swapping'
4538
+ Enabled: pending
4539
+ VersionAdded: '1.1'
4540
+ SafeAutoCorrect: false
4541
+
4542
+ Style/SymbolArray:
4543
+ Description: 'Use %i or %I for arrays of symbols.'
4544
+ StyleGuide: '#percent-i'
4545
+ Enabled: true
4546
+ VersionAdded: '0.9'
4547
+ VersionChanged: '0.49'
4548
+ EnforcedStyle: percent
4549
+ MinSize: 2
4550
+ SupportedStyles:
4551
+ - percent
4552
+ - brackets
4553
+
4554
+ Style/SymbolLiteral:
4555
+ Description: 'Use plain symbols instead of string symbols when possible.'
4556
+ Enabled: true
4557
+ VersionAdded: '0.30'
4558
+
4559
+ Style/SymbolProc:
4560
+ Description: 'Use symbols as procs instead of blocks when possible.'
4561
+ Enabled: true
4562
+ Safe: false
4563
+ VersionAdded: '0.26'
4564
+ VersionChanged: '1.5'
4565
+ # A list of method names to be ignored by the check.
4566
+ # The names should be fairly unique, otherwise you'll end up ignoring lots of code.
4567
+ IgnoredMethods:
4568
+ - respond_to
4569
+ - define_method
4570
+
4571
+ Style/TernaryParentheses:
4572
+ Description: 'Checks for use of parentheses around ternary conditions.'
4573
+ Enabled: true
4574
+ VersionAdded: '0.42'
4575
+ VersionChanged: '0.46'
4576
+ EnforcedStyle: require_no_parentheses
4577
+ SupportedStyles:
4578
+ - require_parentheses
4579
+ - require_no_parentheses
4580
+ - require_parentheses_when_complex
4581
+ AllowSafeAssignment: true
4582
+
4583
+ Style/TrailingBodyOnClass:
4584
+ Description: 'Class body goes below class statement.'
4585
+ Enabled: true
4586
+ VersionAdded: '0.53'
4587
+
4588
+ Style/TrailingBodyOnMethodDefinition:
4589
+ Description: 'Method body goes below definition.'
4590
+ Enabled: true
4591
+ VersionAdded: '0.52'
4592
+
4593
+ Style/TrailingBodyOnModule:
4594
+ Description: 'Module body goes below module statement.'
4595
+ Enabled: true
4596
+ VersionAdded: '0.53'
4597
+
4598
+ Style/TrailingCommaInArguments:
4599
+ Description: 'Checks for trailing comma in argument lists.'
4600
+ StyleGuide: '#no-trailing-params-comma'
4601
+ Enabled: true
4602
+ VersionAdded: '0.36'
4603
+ # If `comma`, the cop requires a comma after the last argument, but only for
4604
+ # parenthesized method calls where each argument is on its own line.
4605
+ # If `consistent_comma`, the cop requires a comma after the last argument,
4606
+ # for all parenthesized method calls with arguments.
4607
+ EnforcedStyleForMultiline: no_comma
4608
+ SupportedStylesForMultiline:
4609
+ - comma
4610
+ - consistent_comma
4611
+ - no_comma
4612
+
4613
+ Style/TrailingCommaInArrayLiteral:
4614
+ Description: 'Checks for trailing comma in array literals.'
4615
+ StyleGuide: '#no-trailing-array-commas'
4616
+ Enabled: true
4617
+ VersionAdded: '0.53'
4618
+ # If `comma`, the cop requires a comma after the last item in an array,
4619
+ # but only when each item is on its own line.
4620
+ # If `consistent_comma`, the cop requires a comma after the last item of all
4621
+ # non-empty, multiline array literals.
4622
+ EnforcedStyleForMultiline: no_comma
4623
+ SupportedStylesForMultiline:
4624
+ - comma
4625
+ - consistent_comma
4626
+ - no_comma
4627
+
4628
+ Style/TrailingCommaInBlockArgs:
4629
+ Description: 'Checks for useless trailing commas in block arguments.'
4630
+ Enabled: false
4631
+ Safe: false
4632
+ VersionAdded: '0.81'
4633
+
4634
+ Style/TrailingCommaInHashLiteral:
4635
+ Description: 'Checks for trailing comma in hash literals.'
4636
+ Enabled: true
4637
+ # If `comma`, the cop requires a comma after the last item in a hash,
4638
+ # but only when each item is on its own line.
4639
+ # If `consistent_comma`, the cop requires a comma after the last item of all
4640
+ # non-empty, multiline hash literals.
4641
+ EnforcedStyleForMultiline: no_comma
4642
+ SupportedStylesForMultiline:
4643
+ - comma
4644
+ - consistent_comma
4645
+ - no_comma
4646
+ VersionAdded: '0.53'
4647
+
4648
+ Style/TrailingMethodEndStatement:
4649
+ Description: 'Checks for trailing end statement on line of method body.'
4650
+ Enabled: true
4651
+ VersionAdded: '0.52'
4652
+
4653
+ Style/TrailingUnderscoreVariable:
4654
+ Description: >-
4655
+ Checks for the usage of unneeded trailing underscores at the
4656
+ end of parallel variable assignment.
4657
+ AllowNamedUnderscoreVariables: true
4658
+ Enabled: true
4659
+ VersionAdded: '0.31'
4660
+ VersionChanged: '0.35'
4661
+
4662
+ # `TrivialAccessors` requires exact name matches and doesn't allow
4663
+ # predicated methods by default.
4664
+ Style/TrivialAccessors:
4665
+ Description: 'Prefer attr_* methods to trivial readers/writers.'
4666
+ StyleGuide: '#attr_family'
4667
+ Enabled: true
4668
+ VersionAdded: '0.9'
4669
+ VersionChanged: '0.77'
4670
+ # When set to `false` the cop will suggest the use of accessor methods
4671
+ # in situations like:
4672
+ #
4673
+ # def name
4674
+ # @other_name
4675
+ # end
4676
+ #
4677
+ # This way you can uncover "hidden" attributes in your code.
4678
+ ExactNameMatch: true
4679
+ AllowPredicates: true
4680
+ # Allows trivial writers that don't end in an equal sign. e.g.
4681
+ #
4682
+ # def on_exception(action)
4683
+ # @on_exception=action
4684
+ # end
4685
+ # on_exception :restart
4686
+ #
4687
+ # Commonly used in DSLs
4688
+ AllowDSLWriters: false
4689
+ IgnoreClassMethods: false
4690
+ AllowedMethods:
4691
+ - to_ary
4692
+ - to_a
4693
+ - to_c
4694
+ - to_enum
4695
+ - to_h
4696
+ - to_hash
4697
+ - to_i
4698
+ - to_int
4699
+ - to_io
4700
+ - to_open
4701
+ - to_path
4702
+ - to_proc
4703
+ - to_r
4704
+ - to_regexp
4705
+ - to_str
4706
+ - to_s
4707
+ - to_sym
4708
+
4709
+ Style/UnlessElse:
4710
+ Description: >-
4711
+ Do not use unless with else. Rewrite these with the positive
4712
+ case first.
4713
+ StyleGuide: '#no-else-with-unless'
4714
+ Enabled: true
4715
+ VersionAdded: '0.9'
4716
+
4717
+ Style/UnpackFirst:
4718
+ Description: >-
4719
+ Checks for accessing the first element of `String#unpack`
4720
+ instead of using `unpack1`.
4721
+ Enabled: true
4722
+ VersionAdded: '0.54'
4723
+
4724
+ Style/VariableInterpolation:
4725
+ Description: >-
4726
+ Don't interpolate global, instance and class variables
4727
+ directly in strings.
4728
+ StyleGuide: '#curlies-interpolate'
4729
+ Enabled: true
4730
+ VersionAdded: '0.9'
4731
+ VersionChanged: '0.20'
4732
+
4733
+ Style/WhenThen:
4734
+ Description: 'Use when x then ... for one-line cases.'
4735
+ StyleGuide: '#one-line-cases'
4736
+ Enabled: true
4737
+ VersionAdded: '0.9'
4738
+
4739
+ Style/WhileUntilDo:
4740
+ Description: 'Checks for redundant do after while or until.'
4741
+ StyleGuide: '#no-multiline-while-do'
4742
+ Enabled: true
4743
+ VersionAdded: '0.9'
4744
+
4745
+ Style/WhileUntilModifier:
4746
+ Description: >-
4747
+ Favor modifier while/until usage when you have a
4748
+ single-line body.
4749
+ StyleGuide: '#while-as-a-modifier'
4750
+ Enabled: true
4751
+ VersionAdded: '0.9'
4752
+ VersionChanged: '0.30'
4753
+
4754
+ Style/WordArray:
4755
+ Description: 'Use %w or %W for arrays of words.'
4756
+ StyleGuide: '#percent-w'
4757
+ Enabled: true
4758
+ VersionAdded: '0.9'
4759
+ VersionChanged: '0.36'
4760
+ EnforcedStyle: percent
4761
+ SupportedStyles:
4762
+ # percent style: %w(word1 word2)
4763
+ - percent
4764
+ # bracket style: ['word1', 'word2']
4765
+ - brackets
4766
+ # The `MinSize` option causes the `WordArray` rule to be ignored for arrays
4767
+ # smaller than a certain size. The rule is only applied to arrays
4768
+ # whose element count is greater than or equal to `MinSize`.
4769
+ MinSize: 2
4770
+ # The regular expression `WordRegex` decides what is considered a word.
4771
+ WordRegex: !ruby/regexp '/\A(?:\p{Word}|\p{Word}-\p{Word}|\n|\t)+\z/'
4772
+
4773
+ Style/YodaCondition:
4774
+ Description: 'Forbid or enforce yoda conditions.'
4775
+ Reference: 'https://en.wikipedia.org/wiki/Yoda_conditions'
4776
+ Enabled: true
4777
+ EnforcedStyle: forbid_for_all_comparison_operators
4778
+ SupportedStyles:
4779
+ # check all comparison operators
4780
+ - forbid_for_all_comparison_operators
4781
+ # check only equality operators: `!=` and `==`
4782
+ - forbid_for_equality_operators_only
4783
+ # enforce yoda for all comparison operators
4784
+ - require_for_all_comparison_operators
4785
+ # enforce yoda only for equality operators: `!=` and `==`
4786
+ - require_for_equality_operators_only
4787
+ Safe: false
4788
+ VersionAdded: '0.49'
4789
+ VersionChanged: '0.75'
4790
+
4791
+ Style/ZeroLengthPredicate:
4792
+ Description: 'Use #empty? when testing for objects of length 0.'
4793
+ Enabled: true
4794
+ Safe: false
4795
+ VersionAdded: '0.37'
4796
+ VersionChanged: '0.39'