rubocop-rubomatic 1.0.0.pre.rc.1

Sign up to get free protection for your applications and to get access to all the features.
data/config/layout.yml ADDED
@@ -0,0 +1,1217 @@
1
+ Layout/AccessModifierIndentation:
2
+ Description: Check indentation of private/protected visibility modifiers.
3
+ StyleGuide: '#indent-public-private-protected'
4
+ Enabled: true
5
+ VersionAdded: '0.49'
6
+ EnforcedStyle: indent
7
+ SupportedStyles:
8
+ - outdent
9
+ - indent
10
+
11
+ Layout/ArgumentAlignment:
12
+ Description: >-
13
+ Align the arguments of a method call if they span more
14
+ than one line.
15
+ StyleGuide: '#no-double-indent'
16
+ Enabled: true
17
+ VersionAdded: '0.68'
18
+ VersionChanged: '0.77'
19
+ # Alignment of arguments in multi-line method calls.
20
+ #
21
+ # The `with_first_argument` style aligns the following lines along the same
22
+ # column as the first parameter.
23
+ #
24
+ # method_call(a,
25
+ # b)
26
+ #
27
+ # The `with_fixed_indentation` style aligns the following lines with one
28
+ # level of indentation relative to the start of the line with the method call.
29
+ #
30
+ # method_call(a,
31
+ # b)
32
+ EnforcedStyle: with_first_argument
33
+ SupportedStyles:
34
+ - with_first_argument
35
+ - with_fixed_indentation
36
+
37
+ Layout/ArrayAlignment:
38
+ Description: >-
39
+ Align the elements of an array literal if they span more than
40
+ one line.
41
+ StyleGuide: '#no-double-indent'
42
+ Enabled: true
43
+ VersionAdded: '0.49'
44
+ VersionChanged: '0.77'
45
+ # Alignment of elements of a multi-line array.
46
+ #
47
+ # The `with_first_parameter` style aligns the following lines along the same
48
+ # column as the first element.
49
+ #
50
+ # array = [1, 2, 3,
51
+ # 4, 5, 6]
52
+ #
53
+ # The `with_fixed_indentation` style aligns the following lines with one
54
+ # level of indentation relative to the start of the line with start of array.
55
+ #
56
+ # array = [1, 2, 3,
57
+ # 4, 5, 6]
58
+ EnforcedStyle: with_first_element
59
+ SupportedStyles:
60
+ - with_first_element
61
+ - with_fixed_indentation
62
+
63
+ Layout/AssignmentIndentation:
64
+ Description: >-
65
+ Checks the indentation of the first line of the
66
+ right-hand-side of a multi-line assignment.
67
+ Enabled: true
68
+ VersionAdded: '0.49'
69
+ VersionChanged: '1.40'
70
+
71
+ Layout/BeginEndAlignment:
72
+ Description: 'Align ends corresponding to begins correctly.'
73
+ Enabled: true
74
+ VersionAdded: '0.91'
75
+ # The value `start_of_line` means that `end` should be aligned the start of the line
76
+ # where the `begin` keyword is.
77
+ # The value `begin` means that `end` should be aligned with the `begin` keyword.
78
+ EnforcedStyleAlignWith: begin
79
+ SupportedStylesAlignWith:
80
+ - start_of_line
81
+ - begin
82
+ Severity: warning
83
+
84
+ Layout/BlockAlignment:
85
+ Description: 'Align block ends correctly.'
86
+ Enabled: true
87
+ VersionAdded: '0.53'
88
+ # The value `start_of_block` means that the `end` should be aligned with line
89
+ # where the `do` keyword appears.
90
+ # The value `start_of_line` means it should be aligned with the whole
91
+ # expression's starting line.
92
+ # The value `either` means both are allowed.
93
+ EnforcedStyleAlignWith: either
94
+ SupportedStylesAlignWith:
95
+ - either
96
+ - start_of_block
97
+ - start_of_line
98
+
99
+ Layout/BlockEndNewline:
100
+ Description: 'Put end statement of multiline block on its own line.'
101
+ Enabled: true
102
+ VersionAdded: '0.49'
103
+
104
+ Layout/CaseIndentation:
105
+ Description: 'Indentation of when in a case/(when|in)/[else/]end.'
106
+ StyleGuide: '#indent-when-to-case'
107
+ Enabled: true
108
+ VersionAdded: '0.49'
109
+ VersionChanged: '1.16'
110
+ EnforcedStyle: case
111
+ SupportedStyles:
112
+ - case
113
+ - end
114
+ IndentOneStep: false
115
+
116
+ Layout/ClassStructure:
117
+ Description: 'Enforces a configured order of definitions within a class body.'
118
+ StyleGuide: '#consistent-classes'
119
+ Enabled: true
120
+ VersionAdded: '0.52'
121
+ Categories:
122
+ default_scope:
123
+ - default_scope
124
+ - protect_from_forgery
125
+ - skip_forgery_protection
126
+ callbacks:
127
+ - before_save
128
+ - after_save
129
+ - before_create
130
+ - after_create
131
+ - before_update
132
+ - after_update
133
+ - before_validation
134
+ - after_validation
135
+ - before_destroy
136
+ - after_destroy
137
+ - after_commit
138
+ - after_rollback
139
+ - before_action
140
+ - skip_before_action
141
+ - around_action
142
+ - skip_around_action
143
+ - after_action
144
+ - skip_after_action
145
+ module_inclusion:
146
+ - prepend
147
+ - extend
148
+ - include
149
+ view_module_inclusion:
150
+ - helper
151
+ belongs_to:
152
+ - belongs_to
153
+ has_one:
154
+ - has_one
155
+ has_many:
156
+ - has_many
157
+ nested_attributes:
158
+ - accepts_nested_attributes_for
159
+ valids:
160
+ - validates
161
+ - validate
162
+ - validates_length_of
163
+ - validates_associated
164
+ encrypt:
165
+ - encrypts
166
+ scopes:
167
+ - scope
168
+ bool_scopes:
169
+ - boolean_scope
170
+ enum:
171
+ - enum
172
+ delegate:
173
+ - delegate
174
+ attribute_macros:
175
+ - attr_writer
176
+ - attr_reader
177
+ - attr_accessor
178
+ ExpectedOrder:
179
+ - default_scope
180
+ - constants
181
+ - module_inclusion
182
+ - view_module_inclusion
183
+ - callbacks
184
+ - belongs_to
185
+ - has_one
186
+ - has_many
187
+ - nested_attributes
188
+ - valids
189
+ - encrypt
190
+ - scopes
191
+ - bool_scopes
192
+ - enum
193
+ - public_attribute_macros
194
+ - delegate
195
+ - public_class_methods
196
+ - initializer
197
+ - public_methods
198
+ - protected_attribute_macros
199
+ - protected_methods
200
+ - private_attribute_macros
201
+ - private_delegate
202
+ - private_methods
203
+
204
+ Layout/ClosingHeredocIndentation:
205
+ Description: 'Checks the indentation of here document closings.'
206
+ Enabled: true
207
+ VersionAdded: '0.57'
208
+
209
+ Layout/ClosingParenthesisIndentation:
210
+ Description: 'Checks the indentation of hanging closing parentheses.'
211
+ Enabled: true
212
+ VersionAdded: '0.49'
213
+
214
+ Layout/CommentIndentation:
215
+ Description: 'Indentation of comments.'
216
+ Enabled: true
217
+ # When true, allows comments to have extra indentation if that aligns them
218
+ # with a comment on the preceding line.
219
+ AllowForAlignment: false
220
+ VersionAdded: '0.49'
221
+ VersionChanged: '1.24'
222
+
223
+ Layout/ConditionPosition:
224
+ Description: >-
225
+ Checks for condition placed in a confusing position relative to
226
+ the keyword.
227
+ StyleGuide: '#same-line-condition'
228
+ Enabled: true
229
+ VersionAdded: '0.53'
230
+ VersionChanged: '0.83'
231
+
232
+ Layout/DefEndAlignment:
233
+ Description: 'Align ends corresponding to defs correctly.'
234
+ Enabled: true
235
+ VersionAdded: '0.53'
236
+ # The value `def` means that `end` should be aligned with the def keyword.
237
+ # The value `start_of_line` means that `end` should be aligned with method
238
+ # calls like `private`, `public`, etc, if present in front of the `def`
239
+ # keyword on the same line.
240
+ EnforcedStyleAlignWith: start_of_line
241
+ SupportedStylesAlignWith:
242
+ - start_of_line
243
+ - def
244
+ Severity: warning
245
+
246
+ Layout/DotPosition:
247
+ Description: 'Checks the position of the dot in multi-line method calls.'
248
+ StyleGuide: '#consistent-multi-line-chains'
249
+ Enabled: true
250
+ VersionAdded: '0.49'
251
+ EnforcedStyle: leading
252
+ SupportedStyles:
253
+ - leading
254
+ - trailing
255
+
256
+ Layout/ElseAlignment:
257
+ Description: 'Align elses and elsifs correctly.'
258
+ Enabled: true
259
+ VersionAdded: '0.49'
260
+
261
+ Layout/EmptyComment:
262
+ Description: 'Checks empty comment.'
263
+ Enabled: true
264
+ VersionAdded: '0.53'
265
+ AllowBorderComment: true
266
+ AllowMarginComment: true
267
+
268
+ Layout/EmptyLineAfterGuardClause:
269
+ Description: 'Add empty line after guard clause.'
270
+ Enabled: true
271
+ VersionAdded: '0.56'
272
+ VersionChanged: '0.59'
273
+
274
+ Layout/EmptyLineAfterMagicComment:
275
+ Description: 'Add an empty line after magic comments to separate them from code.'
276
+ StyleGuide: '#separate-magic-comments-from-code'
277
+ Enabled: true
278
+ VersionAdded: '0.49'
279
+
280
+ Layout/EmptyLineAfterMultilineCondition:
281
+ Description: 'Enforces empty line after multiline condition.'
282
+ # This is disabled, because this style is not very common in practice.
283
+ Enabled: false
284
+ VersionAdded: '0.90'
285
+ Reference:
286
+ - https://github.com/airbnb/ruby#multiline-if-newline
287
+
288
+ Layout/EmptyLineBetweenDefs:
289
+ Description: 'Use empty lines between class/module/method defs.'
290
+ StyleGuide: '#empty-lines-between-methods'
291
+ Enabled: true
292
+ VersionAdded: '0.49'
293
+ VersionChanged: '1.23'
294
+ EmptyLineBetweenMethodDefs: true
295
+ EmptyLineBetweenClassDefs: true
296
+ EmptyLineBetweenModuleDefs: true
297
+ # `AllowAdjacentOneLineDefs` means that single line method definitions don't
298
+ # need an empty line between them. `true` by default.
299
+ AllowAdjacentOneLineDefs: true
300
+ # Can be array to specify minimum and maximum number of empty lines, e.g. [1, 2]
301
+ NumberOfEmptyLines: 1
302
+
303
+ Layout/EmptyLines:
304
+ Description: "Don't use several empty lines in a row."
305
+ StyleGuide: '#two-or-more-empty-lines'
306
+ Enabled: true
307
+ VersionAdded: '0.49'
308
+
309
+ Layout/EmptyLinesAroundAccessModifier:
310
+ Description: "Keep blank lines around access modifiers."
311
+ StyleGuide: '#empty-lines-around-access-modifier'
312
+ Enabled: true
313
+ VersionAdded: '0.49'
314
+ EnforcedStyle: around
315
+ SupportedStyles:
316
+ - around
317
+ - only_before
318
+ Reference:
319
+ # A reference to `EnforcedStyle: only_before`.
320
+ - https://edgeguides.rubyonrails.org/contributing_to_ruby_on_rails.html#follow-the-coding-conventions
321
+
322
+ Layout/EmptyLinesAroundArguments:
323
+ Description: "Keeps track of empty lines around method arguments."
324
+ Enabled: true
325
+ VersionAdded: '0.52'
326
+
327
+ Layout/EmptyLinesAroundAttributeAccessor:
328
+ Description: "Keep blank lines around attribute accessors."
329
+ StyleGuide: '#empty-lines-around-attribute-accessor'
330
+ Enabled: true
331
+ VersionAdded: '0.83'
332
+ VersionChanged: '0.84'
333
+ AllowAliasSyntax: true
334
+ AllowedMethods:
335
+ - alias_method
336
+ - public
337
+ - protected
338
+ - private
339
+
340
+ Layout/EmptyLinesAroundBeginBody:
341
+ Description: "Keeps track of empty lines around begin-end bodies."
342
+ StyleGuide: '#empty-lines-around-bodies'
343
+ Enabled: true
344
+ VersionAdded: '0.49'
345
+
346
+ Layout/EmptyLinesAroundBlockBody:
347
+ Description: "Keeps track of empty lines around block bodies."
348
+ StyleGuide: '#empty-lines-around-bodies'
349
+ Enabled: true
350
+ VersionAdded: '0.49'
351
+ EnforcedStyle: no_empty_lines
352
+ SupportedStyles:
353
+ - empty_lines
354
+ - no_empty_lines
355
+
356
+ Layout/EmptyLinesAroundClassBody:
357
+ Description: "Keeps track of empty lines around class bodies."
358
+ StyleGuide: '#empty-lines-around-bodies'
359
+ Enabled: true
360
+ VersionAdded: '0.49'
361
+ VersionChanged: '0.53'
362
+ EnforcedStyle: no_empty_lines
363
+ SupportedStyles:
364
+ - empty_lines
365
+ - empty_lines_except_namespace
366
+ - empty_lines_special
367
+ - no_empty_lines
368
+ - beginning_only
369
+ - ending_only
370
+
371
+ Layout/EmptyLinesAroundExceptionHandlingKeywords:
372
+ Description: "Keeps track of empty lines around exception handling keywords."
373
+ StyleGuide: '#empty-lines-around-bodies'
374
+ Enabled: true
375
+ VersionAdded: '0.49'
376
+
377
+ Layout/EmptyLinesAroundMethodBody:
378
+ Description: "Keeps track of empty lines around method bodies."
379
+ StyleGuide: '#empty-lines-around-bodies'
380
+ Enabled: true
381
+ VersionAdded: '0.49'
382
+
383
+ Layout/EmptyLinesAroundModuleBody:
384
+ Description: "Keeps track of empty lines around module bodies."
385
+ StyleGuide: '#empty-lines-around-bodies'
386
+ Enabled: true
387
+ VersionAdded: '0.49'
388
+ EnforcedStyle: no_empty_lines
389
+ SupportedStyles:
390
+ - empty_lines
391
+ - empty_lines_except_namespace
392
+ - empty_lines_special
393
+ - no_empty_lines
394
+
395
+ Layout/EndAlignment:
396
+ Description: 'Align ends correctly.'
397
+ Enabled: true
398
+ VersionAdded: '0.53'
399
+ # The value `keyword` means that `end` should be aligned with the matching
400
+ # keyword (`if`, `while`, etc.).
401
+ # The value `variable` means that in assignments, `end` should be aligned
402
+ # with the start of the variable on the left hand side of `=`. In all other
403
+ # situations, `end` should still be aligned with the keyword.
404
+ # The value `start_of_line` means that `end` should be aligned with the start
405
+ # of the line which the matching keyword appears on.
406
+ EnforcedStyleAlignWith: keyword
407
+ SupportedStylesAlignWith:
408
+ - keyword
409
+ - variable
410
+ - start_of_line
411
+ Severity: warning
412
+
413
+ Layout/EndOfLine:
414
+ Description: 'Use Unix-style line endings.'
415
+ StyleGuide: '#crlf'
416
+ Enabled: true
417
+ VersionAdded: '0.49'
418
+ # The `native` style means that CR+LF (Carriage Return + Line Feed) is
419
+ # enforced on Windows, and LF is enforced on other platforms. The other styles
420
+ # mean LF and CR+LF, respectively.
421
+ EnforcedStyle: native
422
+ SupportedStyles:
423
+ - native
424
+ - lf
425
+ - crlf
426
+
427
+ Layout/ExtraSpacing:
428
+ Description: 'Do not use unnecessary spacing.'
429
+ Enabled: true
430
+ VersionAdded: '0.49'
431
+ # When true, allows most uses of extra spacing if the intent is to align
432
+ # things with the previous or next line, not counting empty lines or comment
433
+ # lines.
434
+ AllowForAlignment: true
435
+ # When true, allows things like 'obj.meth(arg) # comment',
436
+ # rather than insisting on 'obj.meth(arg) # comment'.
437
+ # If done for alignment, either this OR AllowForAlignment will allow it.
438
+ AllowBeforeTrailingComments: false
439
+ # When true, forces the alignment of `=` in assignments on consecutive lines.
440
+ ForceEqualSignAlignment: false
441
+
442
+ Layout/FirstArgumentIndentation:
443
+ Description: 'Checks the indentation of the first argument in a method call.'
444
+ Enabled: true
445
+ VersionAdded: '0.68'
446
+ VersionChanged: '0.77'
447
+ EnforcedStyle: consistent
448
+ SupportedStyles:
449
+ # The first parameter should always be indented one step more than the
450
+ # preceding line.
451
+ - consistent
452
+ # The first parameter should always be indented one level relative to the
453
+ # parent that is receiving the parameter
454
+ - consistent_relative_to_receiver
455
+ # The first parameter should normally be indented one step more than the
456
+ # preceding line, but if it's a parameter for a method call that is itself
457
+ # a parameter in a method call, then the inner parameter should be indented
458
+ # relative to the inner method.
459
+ - special_for_inner_method_call
460
+ # Same as `special_for_inner_method_call` except that the special rule only
461
+ # applies if the outer method call encloses its arguments in parentheses.
462
+ - special_for_inner_method_call_in_parentheses
463
+
464
+ Layout/FirstArrayElementIndentation:
465
+ Description: >-
466
+ Checks the indentation of the first element in an array
467
+ literal.
468
+ Enabled: true
469
+ VersionAdded: '0.68'
470
+ VersionChanged: '0.77'
471
+ # The value `special_inside_parentheses` means that array literals with
472
+ # brackets that have their opening bracket on the same line as a surrounding
473
+ # opening round parenthesis, shall have their first element indented relative
474
+ # to the first position inside the parenthesis.
475
+ #
476
+ # The value `consistent` means that the indentation of the first element shall
477
+ # always be relative to the first position of the line where the opening
478
+ # bracket is.
479
+ #
480
+ # The value `align_brackets` means that the indentation of the first element
481
+ # shall always be relative to the position of the opening bracket.
482
+ EnforcedStyle: consistent
483
+ SupportedStyles:
484
+ - special_inside_parentheses
485
+ - consistent
486
+ - align_brackets
487
+
488
+ Layout/FirstArrayElementLineBreak:
489
+ Description: >-
490
+ Checks for a line break before the first element in a
491
+ multi-line array.
492
+ Enabled: false
493
+ VersionAdded: '0.49'
494
+ AllowMultilineFinalElement: false
495
+
496
+ Layout/FirstHashElementIndentation:
497
+ Description: 'Checks the indentation of the first key in a hash literal.'
498
+ Enabled: true
499
+ VersionAdded: '0.68'
500
+ VersionChanged: '0.77'
501
+ # The value `special_inside_parentheses` means that hash literals with braces
502
+ # that have their opening brace on the same line as a surrounding opening
503
+ # round parenthesis, shall have their first key indented relative to the
504
+ # first position inside the parenthesis.
505
+ #
506
+ # The value `consistent` means that the indentation of the first key shall
507
+ # always be relative to the first position of the line where the opening
508
+ # brace is.
509
+ #
510
+ # The value `align_braces` means that the indentation of the first key shall
511
+ # always be relative to the position of the opening brace.
512
+ EnforcedStyle: consistent
513
+ SupportedStyles:
514
+ - special_inside_parentheses
515
+ - consistent
516
+ - align_braces
517
+
518
+ Layout/FirstHashElementLineBreak:
519
+ Description: >-
520
+ Checks for a line break before the first element in a
521
+ multi-line hash.
522
+ Enabled: false
523
+ VersionAdded: '0.49'
524
+ AllowMultilineFinalElement: false
525
+
526
+ Layout/FirstMethodArgumentLineBreak:
527
+ Description: >-
528
+ Checks for a line break before the first argument in a
529
+ multi-line method call.
530
+ Enabled: true
531
+ VersionAdded: '0.49'
532
+ AllowMultilineFinalElement: true
533
+
534
+ Layout/FirstMethodParameterLineBreak:
535
+ Description: >-
536
+ Checks for a line break before the first parameter in a
537
+ multi-line method parameter definition.
538
+ Enabled: false
539
+ VersionAdded: '0.49'
540
+ AllowMultilineFinalElement: false
541
+
542
+ Layout/FirstParameterIndentation:
543
+ Description: >-
544
+ Checks the indentation of the first parameter in a
545
+ method definition.
546
+ Enabled: true
547
+ VersionAdded: '0.49'
548
+ VersionChanged: '0.77'
549
+ EnforcedStyle: consistent
550
+ SupportedStyles:
551
+ - consistent
552
+ - align_parentheses
553
+
554
+ Layout/HashAlignment:
555
+ Description: >-
556
+ Align the elements of a hash literal if they span more than
557
+ one line.
558
+ Enabled: true
559
+ AllowMultipleStyles: true
560
+ VersionAdded: '0.49'
561
+ VersionChanged: '1.16'
562
+ # Alignment of entries using hash rocket as separator. Valid values are:
563
+ #
564
+ # key - left alignment of keys
565
+ # 'a' => 2
566
+ # 'bb' => 3
567
+ # separator - alignment of hash rockets, keys are right aligned
568
+ # 'a' => 2
569
+ # 'bb' => 3
570
+ # table - left alignment of keys, hash rockets, and values
571
+ # 'a' => 2
572
+ # 'bb' => 3
573
+ EnforcedHashRocketStyle:
574
+ - key
575
+ - table
576
+ SupportedHashRocketStyles:
577
+ - key
578
+ - separator
579
+ - table
580
+ # Alignment of entries using colon as separator. Valid values are:
581
+ #
582
+ # key - left alignment of keys
583
+ # a: 0
584
+ # bb: 1
585
+ # separator - alignment of colons, keys are right aligned
586
+ # a: 0
587
+ # bb: 1
588
+ # table - left alignment of keys and values
589
+ # a: 0
590
+ # bb: 1
591
+ EnforcedColonStyle:
592
+ - key
593
+ - table
594
+ SupportedColonStyles:
595
+ - key
596
+ - separator
597
+ - table
598
+ # Select whether hashes that are the last argument in a method call should be
599
+ # inspected? Valid values are:
600
+ #
601
+ # always_inspect - Inspect both implicit and explicit hashes.
602
+ # Registers an offense for:
603
+ # function(a: 1,
604
+ # b: 2)
605
+ # Registers an offense for:
606
+ # function({a: 1,
607
+ # b: 2})
608
+ # always_ignore - Ignore both implicit and explicit hashes.
609
+ # Accepts:
610
+ # function(a: 1,
611
+ # b: 2)
612
+ # Accepts:
613
+ # function({a: 1,
614
+ # b: 2})
615
+ # ignore_implicit - Ignore only implicit hashes.
616
+ # Accepts:
617
+ # function(a: 1,
618
+ # b: 2)
619
+ # Registers an offense for:
620
+ # function({a: 1,
621
+ # b: 2})
622
+ # ignore_explicit - Ignore only explicit hashes.
623
+ # Accepts:
624
+ # function({a: 1,
625
+ # b: 2})
626
+ # Registers an offense for:
627
+ # function(a: 1,
628
+ # b: 2)
629
+ EnforcedLastArgumentHashStyle: ignore_explicit
630
+ SupportedLastArgumentHashStyles:
631
+ - always_inspect
632
+ - always_ignore
633
+ - ignore_implicit
634
+ - ignore_explicit
635
+
636
+ Layout/HeredocArgumentClosingParenthesis:
637
+ Description: >-
638
+ Checks for the placement of the closing parenthesis in a
639
+ method call that passes a HEREDOC string as an argument.
640
+ Enabled: false
641
+ StyleGuide: '#heredoc-argument-closing-parentheses'
642
+ VersionAdded: '0.68'
643
+
644
+ Layout/HeredocIndentation:
645
+ Description: 'Checks the indentation of the here document bodies.'
646
+ StyleGuide: '#squiggly-heredocs'
647
+ Enabled: true
648
+ VersionAdded: '0.49'
649
+ VersionChanged: '0.85'
650
+
651
+ Layout/IndentationConsistency:
652
+ Description: 'Keep indentation straight.'
653
+ StyleGuide: '#spaces-indentation'
654
+ Enabled: true
655
+ VersionAdded: '0.49'
656
+ # The difference between `indented` and `normal` is that the `indented_internal_methods`
657
+ # style prescribes that in classes and modules the `protected` and `private`
658
+ # modifier keywords shall be indented the same as public methods and that
659
+ # protected and private members shall be indented one step more than the
660
+ # modifiers. Other than that, both styles mean that entities on the same
661
+ # logical depth shall have the same indentation.
662
+ EnforcedStyle: indented_internal_methods
663
+ SupportedStyles:
664
+ - normal
665
+ - indented_internal_methods
666
+ Reference:
667
+ # A reference to `EnforcedStyle: indented_internal_methods`.
668
+ - https://edgeguides.rubyonrails.org/contributing_to_ruby_on_rails.html#follow-the-coding-conventions
669
+
670
+ Layout/IndentationStyle:
671
+ Description: 'Consistent indentation either with tabs only or spaces only.'
672
+ StyleGuide: '#spaces-indentation'
673
+ Enabled: true
674
+ VersionAdded: '0.49'
675
+ VersionChanged: '0.82'
676
+ EnforcedStyle: spaces
677
+ SupportedStyles:
678
+ - spaces
679
+ - tabs
680
+
681
+ Layout/IndentationWidth:
682
+ Description: 'Use 2 spaces for indentation.'
683
+ StyleGuide: '#spaces-indentation'
684
+ Enabled: true
685
+ VersionAdded: '0.49'
686
+ # Number of spaces for each indentation level.
687
+ Width: 2
688
+ AllowedPatterns: [ ]
689
+
690
+ Layout/InitialIndentation:
691
+ Description: >-
692
+ Checks the indentation of the first non-blank non-comment line in a file.
693
+ Enabled: true
694
+ VersionAdded: '0.49'
695
+
696
+ Layout/LeadingCommentSpace:
697
+ Description: 'Comments should start with a space.'
698
+ StyleGuide: '#hash-space'
699
+ Enabled: true
700
+ VersionAdded: '0.49'
701
+ VersionChanged: '0.73'
702
+ AllowDoxygenCommentStyle: false
703
+ AllowGemfileRubyComment: false
704
+
705
+ Layout/LeadingEmptyLines:
706
+ Description: Check for unnecessary blank lines at the beginning of a file.
707
+ Enabled: true
708
+ VersionAdded: '0.57'
709
+ VersionChanged: '0.77'
710
+
711
+ Layout/LineContinuationLeadingSpace:
712
+ Description: >-
713
+ Use trailing spaces instead of leading spaces in strings
714
+ broken over multiple lines (by a backslash).
715
+ Enabled: true
716
+ AutoCorrect: false
717
+ VersionAdded: '1.31'
718
+ VersionChanged: '1.32'
719
+ EnforcedStyle: trailing
720
+ SupportedStyles:
721
+ - leading
722
+ - trailing
723
+
724
+ Layout/LineContinuationSpacing:
725
+ Description: 'Checks the spacing in front of backslash in line continuations.'
726
+ Enabled: true
727
+ AutoCorrect: true
728
+ SafeAutoCorrect: true
729
+ VersionAdded: '1.31'
730
+ EnforcedStyle: space
731
+ SupportedStyles:
732
+ - space
733
+ - no_space
734
+
735
+ Layout/LineEndStringConcatenationIndentation:
736
+ Description: >-
737
+ Checks the indentation of the next line after a line that
738
+ ends with a string literal and a backslash.
739
+ Enabled: true
740
+ VersionAdded: '1.18'
741
+ EnforcedStyle: indented
742
+ SupportedStyles:
743
+ - aligned
744
+ - indented
745
+
746
+ Layout/LineLength:
747
+ Description: 'Checks that line length does not exceed the configured limit.'
748
+ StyleGuide: '#max-line-length'
749
+ Enabled: true
750
+ VersionAdded: '0.25'
751
+ VersionChanged: '1.4'
752
+ Max: 120
753
+ # To make it possible to copy or click on URIs in the code, we allow lines
754
+ # containing a URI to be longer than Max.
755
+ AllowHeredoc: true
756
+ AllowURI: true
757
+ URISchemes:
758
+ - http
759
+ - https
760
+ # The IgnoreCopDirectives option causes the LineLength rule to ignore cop
761
+ # directives like '# rubocop: enable ...' when calculating a line's length.
762
+ IgnoreCopDirectives: true
763
+ # The AllowedPatterns option is a list of !ruby/regexp and/or string
764
+ # elements. Strings will be converted to Regexp objects. A line that matches
765
+ # any regular expression listed in this option will be ignored by LineLength.
766
+ AllowedPatterns: [ ]
767
+
768
+ Layout/MultilineArrayBraceLayout:
769
+ Description: >-
770
+ Checks that the closing brace in an array literal is
771
+ either on the same line as the last array element, or
772
+ a new line.
773
+ Enabled: true
774
+ VersionAdded: '0.49'
775
+ EnforcedStyle: symmetrical
776
+ SupportedStyles:
777
+ # symmetrical: closing brace is positioned in same way as opening brace
778
+ # new_line: closing brace is always on a new line
779
+ # same_line: closing brace is always on the same line as last element
780
+ - symmetrical
781
+ - new_line
782
+ - same_line
783
+
784
+ Layout/MultilineArrayLineBreaks:
785
+ Description: >-
786
+ Checks that each item in a multi-line array literal
787
+ starts on a separate line.
788
+ Enabled: false
789
+ VersionAdded: '0.67'
790
+ AllowMultilineFinalElement: false
791
+
792
+ Layout/MultilineAssignmentLayout:
793
+ Description: 'Check for a newline after the assignment operator in multi-line assignments.'
794
+ StyleGuide: '#indent-conditional-assignment'
795
+ Enabled: true
796
+ VersionAdded: '0.49'
797
+ # The types of assignments which are subject to this rule.
798
+ SupportedTypes:
799
+ - case
800
+ - class
801
+ - if
802
+ - kwbegin
803
+ - module
804
+ EnforcedStyle: new_line
805
+ SupportedStyles:
806
+ # Ensures that the assignment operator and the rhs are on the same line for
807
+ # the set of supported types.
808
+ - same_line
809
+ # Ensures that the assignment operator and the rhs are on separate lines
810
+ # for the set of supported types.
811
+ - new_line
812
+
813
+ Layout/MultilineBlockLayout:
814
+ Description: 'Ensures newlines after multiline block do statements.'
815
+ Enabled: true
816
+ VersionAdded: '0.49'
817
+
818
+ Layout/MultilineHashBraceLayout:
819
+ Description: >-
820
+ Checks that the closing brace in a hash literal is
821
+ either on the same line as the last hash element, or
822
+ a new line.
823
+ Enabled: true
824
+ VersionAdded: '0.49'
825
+ EnforcedStyle: symmetrical
826
+ SupportedStyles:
827
+ # symmetrical: closing brace is positioned in same way as opening brace
828
+ # new_line: closing brace is always on a new line
829
+ # same_line: closing brace is always on same line as last element
830
+ - symmetrical
831
+ - new_line
832
+ - same_line
833
+
834
+ Layout/MultilineHashKeyLineBreaks:
835
+ Description: >-
836
+ Checks that each item in a multi-line hash literal
837
+ starts on a separate line.
838
+ Enabled: true
839
+ VersionAdded: '0.67'
840
+ AllowMultilineFinalElement: false
841
+
842
+ Layout/MultilineMethodArgumentLineBreaks:
843
+ Description: >-
844
+ Checks that each argument in a multi-line method call
845
+ starts on a separate line.
846
+ Enabled: true
847
+ VersionAdded: '0.67'
848
+ AllowMultilineFinalElement: true
849
+
850
+ Layout/MultilineMethodCallBraceLayout:
851
+ Description: >-
852
+ Checks that the closing brace in a method call is
853
+ either on the same line as the last method argument, or
854
+ a new line.
855
+ Enabled: true
856
+ VersionAdded: '0.49'
857
+ EnforcedStyle: symmetrical
858
+ SupportedStyles:
859
+ # symmetrical: closing brace is positioned in same way as opening brace
860
+ # new_line: closing brace is always on a new line
861
+ # same_line: closing brace is always on the same line as last argument
862
+ - symmetrical
863
+ - new_line
864
+ - same_line
865
+
866
+ Layout/MultilineMethodCallIndentation:
867
+ Description: >-
868
+ Checks indentation of method calls with the dot operator
869
+ that span more than one line.
870
+ Enabled: true
871
+ VersionAdded: '0.49'
872
+ EnforcedStyle: indented_relative_to_receiver
873
+ SupportedStyles:
874
+ - aligned
875
+ - indented
876
+ - indented_relative_to_receiver
877
+
878
+ Layout/MultilineMethodDefinitionBraceLayout:
879
+ Description: >-
880
+ Checks that the closing brace in a method definition is
881
+ either on the same line as the last method parameter, or
882
+ a new line.
883
+ Enabled: true
884
+ VersionAdded: '0.49'
885
+ EnforcedStyle: symmetrical
886
+ SupportedStyles:
887
+ # symmetrical: closing brace is positioned in same way as opening brace
888
+ # new_line: closing brace is always on a new line
889
+ # same_line: closing brace is always on the same line as last parameter
890
+ - symmetrical
891
+ - new_line
892
+ - same_line
893
+
894
+ Layout/MultilineMethodParameterLineBreaks:
895
+ Description: >-
896
+ Checks that each parameter in a multi-line method definition
897
+ starts on a separate line.
898
+ Enabled: true
899
+ VersionAdded: '1.32'
900
+ AllowMultilineFinalElement: false
901
+
902
+ Layout/MultilineOperationIndentation:
903
+ Description: >-
904
+ Checks indentation of binary operations that span more than
905
+ one line.
906
+ Enabled: true
907
+ VersionAdded: '0.49'
908
+ EnforcedStyle: aligned
909
+ SupportedStyles:
910
+ - aligned
911
+ - indented
912
+
913
+ Layout/ParameterAlignment:
914
+ Description: >-
915
+ Align the parameters of a method definition if they span more
916
+ than one line.
917
+ StyleGuide: '#no-double-indent'
918
+ Enabled: true
919
+ VersionAdded: '0.49'
920
+ VersionChanged: '0.77'
921
+ # Alignment of parameters in multi-line method calls.
922
+ #
923
+ # The `with_first_parameter` style aligns the following lines along the same
924
+ # column as the first parameter.
925
+ #
926
+ # def method_foo(a,
927
+ # b)
928
+ #
929
+ # The `with_fixed_indentation` style aligns the following lines with one
930
+ # level of indentation relative to the start of the line with the method call.
931
+ #
932
+ # def method_foo(a,
933
+ # b)
934
+ EnforcedStyle: with_first_parameter
935
+ SupportedStyles:
936
+ - with_first_parameter
937
+ - with_fixed_indentation
938
+
939
+ Layout/RedundantLineBreak:
940
+ Description: >-
941
+ Do not break up an expression into multiple lines when it fits
942
+ on a single line.
943
+ Enabled: false
944
+ InspectBlocks: true
945
+ VersionAdded: '1.13'
946
+ Exclude:
947
+ - '**/*.jbuilder'
948
+ - 'config/routes.rb'
949
+
950
+ Layout/RescueEnsureAlignment:
951
+ Description: 'Align rescues and ensures correctly.'
952
+ Enabled: true
953
+ VersionAdded: '0.49'
954
+
955
+ Layout/SingleLineBlockChain:
956
+ Description: 'Put method call on a separate line if chained to a single line block.'
957
+ Enabled: false
958
+ VersionAdded: '1.14'
959
+
960
+ Layout/SpaceAfterColon:
961
+ Description: 'Use spaces after colons.'
962
+ StyleGuide: '#spaces-operators'
963
+ Enabled: true
964
+ VersionAdded: '0.49'
965
+
966
+ Layout/SpaceAfterComma:
967
+ Description: 'Use spaces after commas.'
968
+ StyleGuide: '#spaces-operators'
969
+ Enabled: true
970
+ VersionAdded: '0.49'
971
+
972
+ Layout/SpaceAfterMethodName:
973
+ Description: >-
974
+ Do not put a space between a method name and the opening
975
+ parenthesis in a method definition.
976
+ StyleGuide: '#parens-no-spaces'
977
+ Enabled: true
978
+ VersionAdded: '0.49'
979
+
980
+ Layout/SpaceAfterNot:
981
+ Description: Tracks redundant space after the ! operator.
982
+ StyleGuide: '#no-space-bang'
983
+ Enabled: true
984
+ VersionAdded: '0.49'
985
+
986
+ Layout/SpaceAfterSemicolon:
987
+ Description: 'Use spaces after semicolons.'
988
+ StyleGuide: '#spaces-operators'
989
+ Enabled: true
990
+ VersionAdded: '0.49'
991
+
992
+ Layout/SpaceAroundBlockParameters:
993
+ Description: 'Checks the spacing inside and after block parameters pipes.'
994
+ Enabled: true
995
+ VersionAdded: '0.49'
996
+ EnforcedStyleInsidePipes: no_space
997
+ SupportedStylesInsidePipes:
998
+ - space
999
+ - no_space
1000
+
1001
+ Layout/SpaceAroundEqualsInParameterDefault:
1002
+ Description: >-
1003
+ Checks that the equals signs in parameter default assignments
1004
+ have or don't have surrounding space depending on
1005
+ configuration.
1006
+ StyleGuide: '#spaces-around-equals'
1007
+ Enabled: true
1008
+ VersionAdded: '0.49'
1009
+ EnforcedStyle: space
1010
+ SupportedStyles:
1011
+ - space
1012
+ - no_space
1013
+
1014
+ Layout/SpaceAroundKeyword:
1015
+ Description: 'Use a space around keywords if appropriate.'
1016
+ Enabled: true
1017
+ VersionAdded: '0.49'
1018
+
1019
+ Layout/SpaceAroundMethodCallOperator:
1020
+ Description: 'Checks method call operators to not have spaces around them.'
1021
+ Enabled: true
1022
+ VersionAdded: '0.82'
1023
+
1024
+ Layout/SpaceAroundOperators:
1025
+ Description: 'Use a single space around operators.'
1026
+ StyleGuide: '#spaces-operators'
1027
+ Enabled: true
1028
+ VersionAdded: '0.49'
1029
+ # When `true`, allows most uses of extra spacing if the intent is to align
1030
+ # with an operator on the previous or next line, not counting empty lines
1031
+ # or comment lines.
1032
+ AllowForAlignment: true
1033
+ EnforcedStyleForExponentOperator: no_space
1034
+ SupportedStylesForExponentOperator:
1035
+ - space
1036
+ - no_space
1037
+
1038
+ Layout/SpaceBeforeBlockBraces:
1039
+ Description: >-
1040
+ Checks that the left block brace has or doesn't have space
1041
+ before it.
1042
+ Enabled: true
1043
+ VersionAdded: '0.49'
1044
+ EnforcedStyle: space
1045
+ SupportedStyles:
1046
+ - space
1047
+ - no_space
1048
+ EnforcedStyleForEmptyBraces: space
1049
+ SupportedStylesForEmptyBraces:
1050
+ - space
1051
+ - no_space
1052
+ VersionChanged: '0.52'
1053
+
1054
+ Layout/SpaceBeforeBrackets:
1055
+ Description: 'Checks for receiver with a space before the opening brackets.'
1056
+ StyleGuide: '#space-in-brackets-access'
1057
+ Enabled: true
1058
+ VersionAdded: '1.7'
1059
+
1060
+ Layout/SpaceBeforeComma:
1061
+ Description: 'No spaces before commas.'
1062
+ Enabled: true
1063
+ VersionAdded: '0.49'
1064
+
1065
+ Layout/SpaceBeforeComment:
1066
+ Description: >-
1067
+ Checks for missing space between code and a comment on the
1068
+ same line.
1069
+ Enabled: true
1070
+ VersionAdded: '0.49'
1071
+
1072
+ Layout/SpaceBeforeFirstArg:
1073
+ Description: >-
1074
+ Checks that exactly one space is used between a method name
1075
+ and the first argument for method calls without parentheses.
1076
+ Enabled: true
1077
+ VersionAdded: '0.49'
1078
+ # When `true`, allows most uses of extra spacing if the intent is to align
1079
+ # things with the previous or next line, not counting empty lines or comment
1080
+ # lines.
1081
+ AllowForAlignment: false
1082
+
1083
+ Layout/SpaceBeforeSemicolon:
1084
+ Description: 'No spaces before semicolons.'
1085
+ Enabled: true
1086
+ VersionAdded: '0.49'
1087
+
1088
+ Layout/SpaceInLambdaLiteral:
1089
+ Description: 'Checks for spaces in lambda literals.'
1090
+ Enabled: true
1091
+ VersionAdded: '0.49'
1092
+ EnforcedStyle: require_space
1093
+ SupportedStyles:
1094
+ - require_no_space
1095
+ - require_space
1096
+
1097
+ Layout/SpaceInsideArrayLiteralBrackets:
1098
+ Description: 'Checks the spacing inside array literal brackets.'
1099
+ Enabled: true
1100
+ VersionAdded: '0.52'
1101
+ EnforcedStyle: no_space
1102
+ SupportedStyles:
1103
+ - space
1104
+ - no_space
1105
+ # 'compact' normally requires a space inside the brackets, with the exception
1106
+ # that successive left brackets or right brackets are collapsed together
1107
+ - compact
1108
+ EnforcedStyleForEmptyBrackets: no_space
1109
+ SupportedStylesForEmptyBrackets:
1110
+ - space
1111
+ - no_space
1112
+
1113
+ Layout/SpaceInsideArrayPercentLiteral:
1114
+ Description: 'No unnecessary additional spaces between elements in %i/%w literals.'
1115
+ Enabled: true
1116
+ VersionAdded: '0.49'
1117
+
1118
+ Layout/SpaceInsideBlockBraces:
1119
+ Description: >-
1120
+ Checks that block braces have or don't have surrounding space.
1121
+ For blocks taking parameters, checks that the left brace has
1122
+ or doesn't have trailing space.
1123
+ Enabled: true
1124
+ VersionAdded: '0.49'
1125
+ EnforcedStyle: space
1126
+ SupportedStyles:
1127
+ - space
1128
+ - no_space
1129
+ EnforcedStyleForEmptyBraces: no_space
1130
+ SupportedStylesForEmptyBraces:
1131
+ - space
1132
+ - no_space
1133
+ # Space between `{` and `|`. Overrides `EnforcedStyle` if there is a conflict.
1134
+ SpaceBeforeBlockParameters: true
1135
+
1136
+ Layout/SpaceInsideHashLiteralBraces:
1137
+ Description: "Use spaces inside hash literal braces - or don't."
1138
+ StyleGuide: '#spaces-braces'
1139
+ Enabled: true
1140
+ VersionAdded: '0.49'
1141
+ EnforcedStyle: space
1142
+ SupportedStyles:
1143
+ - space
1144
+ - no_space
1145
+ # 'compact' normally requires a space inside hash braces, with the exception
1146
+ # that successive left braces or right braces are collapsed together
1147
+ - compact
1148
+ EnforcedStyleForEmptyBraces: no_space
1149
+ SupportedStylesForEmptyBraces:
1150
+ - space
1151
+ - no_space
1152
+
1153
+ Layout/SpaceInsideParens:
1154
+ Description: 'No spaces after ( or before ).'
1155
+ StyleGuide: '#spaces-braces'
1156
+ Enabled: true
1157
+ VersionAdded: '0.49'
1158
+ VersionChanged: '1.22'
1159
+ EnforcedStyle: no_space
1160
+ SupportedStyles:
1161
+ - space
1162
+ - compact
1163
+ - no_space
1164
+
1165
+ Layout/SpaceInsidePercentLiteralDelimiters:
1166
+ Description: 'No unnecessary spaces inside delimiters of %i/%w/%x literals.'
1167
+ Enabled: true
1168
+ VersionAdded: '0.49'
1169
+
1170
+ Layout/SpaceInsideRangeLiteral:
1171
+ Description: 'No spaces inside range literals.'
1172
+ StyleGuide: '#no-space-inside-range-literals'
1173
+ Enabled: true
1174
+ VersionAdded: '0.49'
1175
+
1176
+ Layout/SpaceInsideReferenceBrackets:
1177
+ Description: 'Checks the spacing inside referential brackets.'
1178
+ Enabled: true
1179
+ VersionAdded: '0.52'
1180
+ VersionChanged: '0.53'
1181
+ EnforcedStyle: no_space
1182
+ SupportedStyles:
1183
+ - space
1184
+ - no_space
1185
+ EnforcedStyleForEmptyBrackets: no_space
1186
+ SupportedStylesForEmptyBrackets:
1187
+ - space
1188
+ - no_space
1189
+
1190
+ Layout/SpaceInsideStringInterpolation:
1191
+ Description: 'Checks for padding/surrounding spaces inside string interpolation.'
1192
+ StyleGuide: '#string-interpolation'
1193
+ Enabled: true
1194
+ VersionAdded: '0.49'
1195
+ EnforcedStyle: no_space
1196
+ SupportedStyles:
1197
+ - space
1198
+ - no_space
1199
+
1200
+ Layout/TrailingEmptyLines:
1201
+ Description: 'Checks trailing blank lines and final newline.'
1202
+ StyleGuide: '#newline-eof'
1203
+ Enabled: true
1204
+ VersionAdded: '0.49'
1205
+ VersionChanged: '0.77'
1206
+ EnforcedStyle: final_newline
1207
+ SupportedStyles:
1208
+ - final_newline
1209
+ - final_blank_line
1210
+
1211
+ Layout/TrailingWhitespace:
1212
+ Description: 'Avoid trailing whitespace.'
1213
+ StyleGuide: '#no-trailing-whitespace'
1214
+ Enabled: true
1215
+ VersionAdded: '0.49'
1216
+ VersionChanged: '1.0'
1217
+ AllowInHeredoc: false