-
Notifications
You must be signed in to change notification settings - Fork 0
/
.rubocop.yml
1032 lines (795 loc) · 16.9 KB
/
.rubocop.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
AllCops:
Exclude:
- 'db/schema.rb'
- 'bin/*'
- 'exe/*'
- 'Gemfile'
- 'Rakefile'
- '*.gemspec'
DisabledByDefault: true
StyleGuideBaseURL: https://shopify.github.io/ruby-style-guide/
Lint/AssignmentInCondition:
Enabled: true
Layout/AccessModifierIndentation:
EnforcedStyle: indent
SupportedStyles:
- outdent
- indent
IndentationWidth:
Style/Alias:
EnforcedStyle: prefer_alias_method
SupportedStyles:
- prefer_alias
- prefer_alias_method
Layout/AlignHash:
EnforcedHashRocketStyle: key
EnforcedColonStyle: key
EnforcedLastArgumentHashStyle: ignore_implicit
SupportedLastArgumentHashStyles:
- always_inspect
- always_ignore
- ignore_implicit
- ignore_explicit
Layout/AlignParameters:
EnforcedStyle: with_fixed_indentation
SupportedStyles:
- with_first_parameter
- with_fixed_indentation
IndentationWidth:
Style/AndOr:
EnforcedStyle: always
SupportedStyles:
- always
- conditionals
Style/BarePercentLiterals:
EnforcedStyle: bare_percent
SupportedStyles:
- percent_q
- bare_percent
Style/BlockDelimiters:
EnforcedStyle: line_count_based
SupportedStyles:
- line_count_based
- semantic
- braces_for_chaining
ProceduralMethods:
- benchmark
- bm
- bmbm
- create
- each_with_object
- measure
- new
- realtime
- tap
- with_object
FunctionalMethods:
- let
- let!
- subject
- watch
IgnoredMethods:
- lambda
- proc
- it
Style/BracesAroundHashParameters:
EnforcedStyle: no_braces
SupportedStyles:
- braces
- no_braces
- context_dependent
Layout/CaseIndentation:
EnforcedStyle: end
SupportedStyles:
- case
- end
IndentOneStep: false
IndentationWidth:
Style/ClassAndModuleChildren:
EnforcedStyle: nested
SupportedStyles:
- nested
- compact
Style/ClassCheck:
EnforcedStyle: is_a?
SupportedStyles:
- is_a?
- kind_of?
Style/CommandLiteral:
EnforcedStyle: percent_x
SupportedStyles:
- backticks
- percent_x
- mixed
AllowInnerBackticks: false
Style/CommentAnnotation:
Keywords:
- TODO
- FIXME
- OPTIMIZE
- HACK
- REVIEW
Style/ConditionalAssignment:
EnforcedStyle: assign_to_condition
SupportedStyles:
- assign_to_condition
- assign_inside_condition
SingleLineConditionsOnly: true
Layout/DotPosition:
EnforcedStyle: leading
SupportedStyles:
- leading
- trailing
Style/EmptyElse:
EnforcedStyle: both
SupportedStyles:
- empty
- nil
- both
Layout/EmptyLineBetweenDefs:
AllowAdjacentOneLineDefs: false
Layout/EmptyLinesAroundBlockBody:
EnforcedStyle: no_empty_lines
SupportedStyles:
- empty_lines
- no_empty_lines
Layout/EmptyLinesAroundClassBody:
EnforcedStyle: no_empty_lines
SupportedStyles:
- empty_lines
- empty_lines_except_namespace
- no_empty_lines
Layout/EmptyLinesAroundModuleBody:
EnforcedStyle: no_empty_lines
SupportedStyles:
- empty_lines
- empty_lines_except_namespace
- no_empty_lines
Layout/ExtraSpacing:
AllowForAlignment: true
ForceEqualSignAlignment: false
Naming/FileName:
Exclude: []
ExpectMatchingDefinition: false
Regex:
IgnoreExecutableScripts: true
Layout/IndentFirstArgument:
EnforcedStyle: consistent
SupportedStyles:
- consistent
- special_for_inner_method_call
- special_for_inner_method_call_in_parentheses
IndentationWidth:
Style/For:
EnforcedStyle: each
SupportedStyles:
- for
- each
Style/FormatString:
EnforcedStyle: format
SupportedStyles:
- format
- sprintf
- percent
Style/FrozenStringLiteralComment:
Details: >-
Add `# frozen_string_literal: true` to the top of the file. Frozen string
literals will become the default in a future Ruby version, and we want to
make sure we're ready.
EnforcedStyle: always
SupportedStyles:
- always
- never
Style/GlobalVars:
AllowedVariables: []
Style/HashSyntax:
EnforcedStyle: ruby19
SupportedStyles:
- ruby19
- hash_rockets
- no_mixed_keys
- ruby19_no_mixed_keys
UseHashRocketsWithSymbolValues: false
PreferHashRocketsForNonAlnumEndingSymbols: false
Layout/IndentationConsistency:
EnforcedStyle: normal
SupportedStyles:
- normal
- rails
Layout/IndentationWidth:
Width: 2
Layout/IndentFirstArrayElement:
EnforcedStyle: consistent
SupportedStyles:
- special_inside_parentheses
- consistent
- align_brackets
IndentationWidth:
Layout/IndentAssignment:
IndentationWidth:
Layout/IndentFirstHashElement:
EnforcedStyle: consistent
SupportedStyles:
- special_inside_parentheses
- consistent
- align_braces
IndentationWidth:
Style/LambdaCall:
EnforcedStyle: call
SupportedStyles:
- call
- braces
Style/Next:
EnforcedStyle: skip_modifier_ifs
MinBodyLength: 3
SupportedStyles:
- skip_modifier_ifs
- always
Style/NonNilCheck:
IncludeSemanticChanges: false
Style/MethodCallWithArgsParentheses:
Enabled: true
IgnoreMacros: true
IgnoredMethods:
- require
- require_relative
- require_dependency
- yield
- raise
- puts
Exclude:
- Gemfile
Style/MethodDefParentheses:
EnforcedStyle: require_parentheses
SupportedStyles:
- require_parentheses
- require_no_parentheses
- require_no_parentheses_except_multiline
Naming/MethodName:
EnforcedStyle: snake_case
SupportedStyles:
- snake_case
- camelCase
Layout/MultilineArrayBraceLayout:
EnforcedStyle: symmetrical
SupportedStyles:
- symmetrical
- new_line
- same_line
Layout/MultilineHashBraceLayout:
EnforcedStyle: symmetrical
SupportedStyles:
- symmetrical
- new_line
- same_line
Layout/MultilineMethodCallBraceLayout:
EnforcedStyle: symmetrical
SupportedStyles:
- symmetrical
- new_line
- same_line
Layout/MultilineMethodCallIndentation:
EnforcedStyle: indented
SupportedStyles:
- aligned
- indented
- indented_relative_to_receiver
IndentationWidth: 2
Layout/MultilineMethodDefinitionBraceLayout:
EnforcedStyle: symmetrical
SupportedStyles:
- symmetrical
- new_line
- same_line
Style/NumericLiteralPrefix:
EnforcedOctalStyle: zero_only
SupportedOctalStyles:
- zero_with_o
- zero_only
Style/ParenthesesAroundCondition:
AllowSafeAssignment: true
Style/PercentQLiterals:
EnforcedStyle: lower_case_q
SupportedStyles:
- lower_case_q
- upper_case_q
Naming/PredicateName:
NamePrefix:
- is_
NamePrefixBlacklist:
- is_
NameWhitelist:
- is_a?
Exclude:
- 'spec/**/*'
Style/PreferredHashMethods:
EnforcedStyle: short
SupportedStyles:
- short
- verbose
Style/RaiseArgs:
EnforcedStyle: exploded
SupportedStyles:
- compact
- exploded
Style/RedundantReturn:
AllowMultipleReturnValues: false
Style/RegexpLiteral:
EnforcedStyle: mixed
SupportedStyles:
- slashes
- percent_r
- mixed
AllowInnerSlashes: false
Style/SafeNavigation:
ConvertCodeThatCanStartToReturnNil: false
Enabled: true
Lint/SafeNavigationChain:
Enabled: true
Style/Semicolon:
AllowAsExpressionSeparator: false
Style/SignalException:
EnforcedStyle: only_raise
SupportedStyles:
- only_raise
- only_fail
- semantic
Style/SingleLineMethods:
AllowIfMethodIsEmpty: true
Layout/SpaceBeforeFirstArg:
AllowForAlignment: true
Style/SpecialGlobalVars:
EnforcedStyle: use_english_names
SupportedStyles:
- use_perl_names
- use_english_names
Style/StabbyLambdaParentheses:
EnforcedStyle: require_parentheses
SupportedStyles:
- require_parentheses
- require_no_parentheses
Style/StringLiteralsInInterpolation:
EnforcedStyle: single_quotes
SupportedStyles:
- single_quotes
- double_quotes
Layout/SpaceAroundBlockParameters:
EnforcedStyleInsidePipes: no_space
SupportedStylesInsidePipes:
- space
- no_space
Layout/SpaceAroundEqualsInParameterDefault:
EnforcedStyle: space
SupportedStyles:
- space
- no_space
Layout/SpaceAroundOperators:
AllowForAlignment: true
Layout/SpaceBeforeBlockBraces:
EnforcedStyle: space
EnforcedStyleForEmptyBraces: space
SupportedStyles:
- space
- no_space
Layout/SpaceInsideBlockBraces:
EnforcedStyle: space
SupportedStyles:
- space
- no_space
EnforcedStyleForEmptyBraces: no_space
SpaceBeforeBlockParameters: true
Layout/SpaceInsideHashLiteralBraces:
EnforcedStyle: space
EnforcedStyleForEmptyBraces: no_space
SupportedStyles:
- space
- no_space
- compact
Layout/SpaceInsideStringInterpolation:
EnforcedStyle: no_space
SupportedStyles:
- space
- no_space
Style/SymbolProc:
IgnoredMethods:
- respond_to
- define_method
Style/TernaryParentheses:
EnforcedStyle: require_no_parentheses
SupportedStyles:
- require_parentheses
- require_no_parentheses
AllowSafeAssignment: true
Layout/TrailingBlankLines:
EnforcedStyle: final_newline
SupportedStyles:
- final_newline
- final_blank_line
Style/TrivialAccessors:
ExactNameMatch: true
AllowPredicates: true
AllowDSLWriters: false
IgnoreClassMethods: false
Whitelist:
- to_ary
- to_a
- to_c
- to_enum
- to_h
- to_hash
- to_i
- to_int
- to_io
- to_open
- to_path
- to_proc
- to_r
- to_regexp
- to_str
- to_s
- to_sym
Naming/VariableName:
EnforcedStyle: snake_case
SupportedStyles:
- snake_case
- camelCase
Style/WhileUntilModifier:
Enabled: true
Metrics/BlockNesting:
Max: 3
Metrics/LineLength:
Max: 120
AllowHeredoc: true
AllowURI: true
URISchemes:
- http
- https
IgnoreCopDirectives: false
IgnoredPatterns:
- '\A\s*(remote_)?test(_\w+)?\s.*(do|->)(\s|\Z)'
Metrics/ParameterLists:
Max: 5
CountKeywordArgs: false
Layout/BlockAlignment:
EnforcedStyleAlignWith: either
SupportedStylesAlignWith:
- either
- start_of_block
- start_of_line
Layout/EndAlignment:
EnforcedStyleAlignWith: variable
SupportedStylesAlignWith:
- keyword
- variable
- start_of_line
Layout/DefEndAlignment:
EnforcedStyleAlignWith: start_of_line
SupportedStylesAlignWith:
- start_of_line
- def
Lint/InheritException:
EnforcedStyle: runtime_error
SupportedStyles:
- runtime_error
- standard_error
Lint/UnusedBlockArgument:
IgnoreEmptyBlocks: true
AllowUnusedKeywordArguments: false
Lint/UnusedMethodArgument:
AllowUnusedKeywordArguments: false
IgnoreEmptyMethods: true
Naming/AccessorMethodName:
Enabled: true
Layout/AlignArray:
Enabled: true
Style/ArrayJoin:
Enabled: true
Naming/AsciiIdentifiers:
Enabled: true
Style/Attr:
Enabled: true
Style/BeginBlock:
Enabled: true
Style/BlockComments:
Enabled: true
Layout/BlockEndNewline:
Enabled: true
Style/CaseEquality:
Enabled: true
Style/CharacterLiteral:
Enabled: true
Naming/ClassAndModuleCamelCase:
Enabled: true
Style/ClassMethods:
Enabled: true
Style/ClassVars:
Enabled: true
Layout/ClosingParenthesisIndentation:
Enabled: true
Style/ColonMethodCall:
Enabled: true
Layout/CommentIndentation:
Enabled: true
Naming/ConstantName:
Enabled: true
Style/DateTime:
Enabled: true
Style/DefWithParentheses:
Enabled: true
Style/EachForSimpleLoop:
Enabled: true
Style/EachWithObject:
Enabled: true
Layout/ElseAlignment:
Enabled: true
Style/EmptyCaseCondition:
Enabled: true
Layout/EmptyLines:
Enabled: true
Layout/EmptyLinesAroundAccessModifier:
Enabled: true
Layout/EmptyLinesAroundMethodBody:
Enabled: true
Style/EmptyLiteral:
Enabled: true
Style/EndBlock:
Enabled: true
Layout/EndOfLine:
Enabled: true
Style/EvenOdd:
Enabled: true
Layout/InitialIndentation:
Enabled: true
Lint/FlipFlop:
Enabled: true
Style/IfInsideElse:
Enabled: true
Style/IfUnlessModifierOfIfUnless:
Enabled: true
Style/IfWithSemicolon:
Enabled: true
Style/IdenticalConditionalBranches:
Enabled: true
Style/InfiniteLoop:
Enabled: true
Layout/LeadingCommentSpace:
Enabled: true
Style/LineEndConcatenation:
Enabled: true
Style/MethodCallWithoutArgsParentheses:
Enabled: true
Style/MethodMissingSuper:
Enabled: true
Style/MissingRespondToMissing:
Enabled: true
Layout/MultilineBlockLayout:
Enabled: true
Style/MultilineIfThen:
Enabled: true
Style/MultilineMemoization:
Enabled: true
Style/MultilineTernaryOperator:
Enabled: true
Style/NegatedIf:
Enabled: true
Style/NegatedWhile:
Enabled: true
Style/NestedModifier:
Enabled: true
Style/NestedParenthesizedCalls:
Enabled: true
Style/NestedTernaryOperator:
Enabled: true
Style/NilComparison:
Enabled: true
Style/Not:
Enabled: true
Style/OneLineConditional:
Enabled: true
Naming/BinaryOperatorParameterName:
Enabled: true
Style/OptionalArguments:
Enabled: true
Style/ParallelAssignment:
Enabled: true
Style/PerlBackrefs:
Enabled: true
Style/Proc:
Enabled: true
Style/RedundantBegin:
Enabled: true
Style/RedundantException:
Enabled: true
Style/RedundantFreeze:
Enabled: true
Style/RedundantParentheses:
Enabled: true
Style/RedundantSelf:
Enabled: true
Style/RedundantSortBy:
Enabled: true
Layout/RescueEnsureAlignment:
Enabled: true
Style/RescueModifier:
Enabled: true
Style/Sample:
Enabled: true
Style/SelfAssignment:
Enabled: true
Layout/SpaceAfterColon:
Enabled: true
Layout/SpaceAfterComma:
Enabled: true
Layout/SpaceAfterMethodName:
Enabled: true
Layout/SpaceAfterNot:
Enabled: true
Layout/SpaceAfterSemicolon:
Enabled: true
Layout/SpaceBeforeComma:
Enabled: true
Layout/SpaceBeforeComment:
Enabled: true
Layout/SpaceBeforeSemicolon:
Enabled: true
Layout/SpaceAroundKeyword:
Enabled: true
Layout/SpaceInsideArrayPercentLiteral:
Enabled: true
Layout/SpaceInsidePercentLiteralDelimiters:
Enabled: true
Layout/SpaceInsideArrayLiteralBrackets:
Enabled: true
Layout/SpaceInsideParens:
Enabled: true
Layout/SpaceInsideRangeLiteral:
Enabled: true
Style/SymbolLiteral:
Enabled: true
Layout/Tab:
Enabled: true
Layout/TrailingWhitespace:
Enabled: true
Style/UnlessElse:
Enabled: true
Style/UnneededCapitalW:
Enabled: true
Style/UnneededInterpolation:
Enabled: true
Style/UnneededPercentQ:
Enabled: true
Style/VariableInterpolation:
Enabled: true
Style/WhenThen:
Enabled: true
Style/WhileUntilDo:
Enabled: true
Style/ZeroLengthPredicate:
Enabled: true
Layout/IndentHeredoc:
EnforcedStyle: squiggly
Lint/AmbiguousOperator:
Enabled: true
Lint/AmbiguousRegexpLiteral:
Enabled: true
Lint/CircularArgumentReference:
Enabled: true
Layout/ConditionPosition:
Enabled: true
Lint/Debugger:
Enabled: true
Lint/DeprecatedClassMethods:
Enabled: true
Lint/DuplicateMethods:
Enabled: true
Lint/DuplicatedKey:
Enabled: true
Lint/EachWithObjectArgument:
Enabled: true
Lint/ElseLayout:
Enabled: true
Lint/EmptyEnsure:
Enabled: true
Lint/EmptyInterpolation:
Enabled: true
Lint/EndInMethod:
Enabled: true
Lint/EnsureReturn:
Enabled: true
Lint/FloatOutOfRange:
Enabled: true
Lint/FormatParameterMismatch:
Enabled: true
Lint/HandleExceptions:
AllowComments: true
Lint/ImplicitStringConcatenation:
Description: Checks for adjacent string literals on the same line, which could
better be represented as a single string literal.
Lint/IneffectiveAccessModifier:
Description: Checks for attempts to use `private` or `protected` to set the visibility
of a class method, which does not work.
Lint/LiteralAsCondition:
Enabled: true
Lint/LiteralInInterpolation:
Enabled: true
Lint/Loop:
Description: Use Kernel#loop with break rather than begin/end/until or begin/end/while
for post-loop tests.
Lint/NestedMethodDefinition:
Enabled: true
Lint/NextWithoutAccumulator:
Description: Do not omit the accumulator when calling `next` in a `reduce`/`inject`
block.
Lint/NonLocalExitFromIterator:
Enabled: true
Lint/ParenthesesAsGroupedExpression:
Enabled: true
Lint/PercentStringArray:
Enabled: true
Lint/PercentSymbolArray:
Enabled: true
Lint/RandOne:
Description: Checks for `rand(1)` calls. Such calls always return `0` and most
likely a mistake.
Lint/RequireParentheses:
Enabled: true
Lint/RescueException:
Enabled: true
Lint/ShadowedException:
Enabled: true
Lint/ShadowingOuterLocalVariable:
Enabled: true
Lint/StringConversionInInterpolation:
Enabled: true
Lint/UnderscorePrefixedVariableName:
Enabled: true
Lint/UnifiedInteger:
Enabled: true
Lint/UnneededCopDisableDirective:
Enabled: true
Lint/UnneededCopEnableDirective:
Enabled: true
Lint/UnneededSplatExpansion:
Enabled: true
Lint/UnreachableCode:
Enabled: true
Lint/UselessAccessModifier:
ContextCreatingMethods: []
Lint/UselessAssignment:
Enabled: true
Lint/UselessComparison:
Enabled: true
Lint/UselessElseWithoutRescue:
Enabled: true
Lint/UselessSetterCall:
Enabled: true
Lint/Void:
Enabled: true
Security/Eval:
Enabled: true
Security/JSONLoad:
Enabled: true
Security/Open: