render_json_rails 0.1.6 → 0.2.2

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