chefstyle 0.4.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -29,32 +29,35 @@ AllCops:
29
29
  - '**/*Fastfile'
30
30
  Exclude:
31
31
  - 'vendor/**/*'
32
- # Default formatter will be used if no -f/--format option is given.
32
+ # Default formatter will be used if no `-f/--format` option is given.
33
33
  DefaultFormatter: progress
34
34
  # Cop names are not displayed in offense messages by default. Change behavior
35
- # by overriding DisplayCopNames, or by giving the -D/--display-cop-names
35
+ # by overriding DisplayCopNames, or by giving the `-D/--display-cop-names`
36
36
  # option.
37
37
  DisplayCopNames: false
38
38
  # Style guide URLs are not displayed in offense messages by default. Change
39
- # behavior by overriding DisplayStyleGuide, or by giving the
40
- # -S/--display-style-guide option.
39
+ # behavior by overriding `DisplayStyleGuide`, or by giving the
40
+ # `-S/--display-style-guide` option.
41
41
  DisplayStyleGuide: false
42
+ # When specifying style guide URLs, any paths and/or fragments will be
43
+ # evaluated relative to the base URL.
44
+ StyleGuideBaseURL: https://github.com/bbatsov/ruby-style-guide
42
45
  # Extra details are not displayed in offense messages by default. Change
43
46
  # behavior by overriding ExtraDetails, or by giving the
44
- # -E/--extra-details option.
47
+ # `-E/--extra-details` option.
45
48
  ExtraDetails: false
46
49
  # Additional cops that do not reference a style guide rule may be enabled by
47
- # default. Change behavior by overriding StyleGuideCopsOnly, or by giving
48
- # the --only-guide-cops option.
50
+ # default. Change behavior by overriding `StyleGuideCopsOnly`, or by giving
51
+ # the `--only-guide-cops` option.
49
52
  StyleGuideCopsOnly: false
50
53
  # All cops except the ones in disabled.yml are enabled by default. Change
51
- # this behavior by overriding DisabledByDefault. When DisabledByDefault is
52
- # true, all cops in the default configuration are disabled, and and only cops
54
+ # this behavior by overriding `DisabledByDefault`. When `DisabledByDefault` is
55
+ # `true`, all cops in the default configuration are disabled, and only cops
53
56
  # in user configuration are enabled. This makes cops opt-in instead of
54
- # opt-out. Note that when DisabledByDefault is true, cops in user
57
+ # opt-out. Note that when `DisabledByDefault` is `true`, cops in user
55
58
  # configuration will be enabled even if they don't set the Enabled parameter.
56
59
  DisabledByDefault: false
57
- # Enables the result cache if true. Can be overridden by the --cache command
60
+ # Enables the result cache if `true`. Can be overridden by the `--cache` command
58
61
  # line option.
59
62
  UseCache: true
60
63
  # Threshold for how many files can be stored in the result cache before some
@@ -77,7 +80,7 @@ AllCops:
77
80
  # run on? (If there is more than one, set this to the lowest version.)
78
81
  # If a value is specified for TargetRubyVersion then it is used.
79
82
  # Else if .ruby-version exists and it contains an MRI version it is used.
80
- # Otherwise we fallback to the oldest officially supported Ruby version (2.0).
83
+ # Otherwise we fallback to the oldest officially supported Ruby version (2.1).
81
84
  TargetRubyVersion: ~
82
85
 
83
86
  # Indent private/protected/public as deep as method definitions
@@ -110,6 +113,10 @@ Style/AlignHash:
110
113
  # 'a' => 2
111
114
  # 'bb' => 3
112
115
  EnforcedHashRocketStyle: key
116
+ SupportedHashRocketStyles:
117
+ - key
118
+ - separator
119
+ - table
113
120
  # Alignment of entries using colon as separator. Valid values are:
114
121
  #
115
122
  # key - left alignment of keys
@@ -122,6 +129,10 @@ Style/AlignHash:
122
129
  # a: 0
123
130
  # bb: 1
124
131
  EnforcedColonStyle: key
132
+ SupportedColonStyles:
133
+ - key
134
+ - separator
135
+ - table
125
136
  # Select whether hashes that are the last argument in a method call should be
126
137
  # inspected? Valid values are:
127
138
  #
@@ -191,7 +202,7 @@ Style/AndOr:
191
202
  - conditionals
192
203
 
193
204
 
194
- # Checks if usage of %() or %Q() matches configuration.
205
+ # Checks if usage of `%()` or `%Q()` matches configuration.
195
206
  Style/BarePercentLiterals:
196
207
  EnforcedStyle: bare_percent
197
208
  SupportedStyles:
@@ -285,14 +296,14 @@ Style/BracesAroundHashParameters:
285
296
 
286
297
  # Indentation of `when`.
287
298
  Style/CaseIndentation:
288
- IndentWhenRelativeTo: case
299
+ EnforcedStyle: case
289
300
  SupportedStyles:
290
301
  - case
291
302
  - end
292
303
  IndentOneStep: false
293
- # By default, the indentation width from Style/IndentationWidth is used
294
- # But it can be overridden by setting this parameter
295
- # This only matters if IndentOneStep is true
304
+ # By default, the indentation width from `Style/IndentationWidth` is used.
305
+ # But it can be overridden by setting this parameter.
306
+ # This only matters if `IndentOneStep` is `true`
296
307
  IndentationWidth: ~
297
308
 
298
309
  Style/ClassAndModuleChildren:
@@ -310,7 +321,7 @@ Style/ClassAndModuleChildren:
310
321
  # class Foo::Bar
311
322
  # end
312
323
  #
313
- # The compact style is only forced, for classes / modules with one child.
324
+ # The compact style is only forced, for classes or modules with one child.
314
325
  EnforcedStyle: nested
315
326
  SupportedStyles:
316
327
  - nested
@@ -337,17 +348,17 @@ Style/CollectionMethods:
337
348
  detect: 'find'
338
349
  find_all: 'select'
339
350
 
340
- # Use ` or %x around command literals.
351
+ # Use '`' or '%x' around command literals.
341
352
  Style/CommandLiteral:
342
353
  EnforcedStyle: backticks
343
354
  # backticks: Always use backticks.
344
- # percent_x: Always use %x.
345
- # mixed: Use backticks on single-line commands, and %x on multi-line commands.
355
+ # percent_x: Always use `%x`.
356
+ # mixed: Use backticks on single-line commands, and `%x` on multi-line commands.
346
357
  SupportedStyles:
347
358
  - backticks
348
359
  - percent_x
349
360
  - mixed
350
- # If false, the cop will always recommend using %x if one or more backticks
361
+ # If `false`, the cop will always recommend using `%x` if one or more backticks
351
362
  # are found in the command string.
352
363
  AllowInnerBackticks: false
353
364
 
@@ -372,14 +383,15 @@ Style/ConditionalAssignment:
372
383
  # will only register an offense for assignment to a condition that has
373
384
  # at least one multiline branch.
374
385
  SingleLineConditionsOnly: true
386
+ IncludeTernaryExpressions: true
375
387
 
376
388
  # Checks that you have put a copyright in a comment before any code.
377
389
  #
378
390
  # You can override the default Notice in your .rubocop.yml file.
379
391
  #
380
392
  # In order to use autocorrect, you must supply a value for the
381
- # AutocorrectNotice key that matches the regexp Notice. A blank
382
- # AutocorrectNotice will cause an error during autocorrect.
393
+ # `AutocorrectNotice` key that matches the regexp Notice. A blank
394
+ # `AutocorrectNotice` will cause an error during autocorrect.
383
395
  #
384
396
  # Autocorrect will add a copyright notice in a comment at the top
385
397
  # of the file immediately after any shebang or encoding comments.
@@ -395,6 +407,9 @@ Style/Copyright:
395
407
  Notice: '^Copyright (\(c\) )?2[0-9]{3} .+'
396
408
  AutocorrectNotice: ''
397
409
 
410
+ Style/DocumentationMethod:
411
+ RequireForNonPublicMethods: false
412
+
398
413
  # Multi-line method chaining should be done with leading dots.
399
414
  Style/DotPosition:
400
415
  EnforcedStyle: leading
@@ -403,9 +418,9 @@ Style/DotPosition:
403
418
  - trailing
404
419
 
405
420
  # Warn on empty else statements
406
- # empty - warn only on empty else
407
- # nil - warn on else with nil in it
408
- # both - warn on empty else and else with nil in it
421
+ # empty - warn only on empty `else`
422
+ # nil - warn on `else` with nil in it
423
+ # both - warn on empty `else` and `else` with nil in it
409
424
  Style/EmptyElse:
410
425
  EnforcedStyle: both
411
426
  SupportedStyles:
@@ -415,7 +430,7 @@ Style/EmptyElse:
415
430
 
416
431
  # Use empty lines between defs.
417
432
  Style/EmptyLineBetweenDefs:
418
- # If true, this parameter means that single line method definitions don't
433
+ # If `true`, this parameter means that single line method definitions don't
419
434
  # need an empty line between them.
420
435
  AllowAdjacentOneLineDefs: false
421
436
 
@@ -429,14 +444,24 @@ Style/EmptyLinesAroundClassBody:
429
444
  EnforcedStyle: no_empty_lines
430
445
  SupportedStyles:
431
446
  - empty_lines
447
+ - empty_lines_except_namespace
448
+ - empty_lines_special
432
449
  - no_empty_lines
433
450
 
434
451
  Style/EmptyLinesAroundModuleBody:
435
452
  EnforcedStyle: no_empty_lines
436
453
  SupportedStyles:
437
454
  - empty_lines
455
+ - empty_lines_except_namespace
456
+ - empty_lines_special
438
457
  - no_empty_lines
439
458
 
459
+ Style/EmptyMethod:
460
+ EnforcedStyle: compact
461
+ SupportedStyles:
462
+ - compact
463
+ - expanded
464
+
440
465
  # Checks whether the source file has a utf-8 encoding comment or not
441
466
  # AutoCorrectEncodingComment must match the regex
442
467
  # /#.*coding\s?[:=]\s?(?:UTF|utf)-8/
@@ -453,19 +478,19 @@ Style/ExtraSpacing:
453
478
  # things with the previous or next line, not counting empty lines or comment
454
479
  # lines.
455
480
  AllowForAlignment: true
456
- # When true, forces the alignment of = in assignments on consecutive lines.
481
+ # When true, forces the alignment of `=` in assignments on consecutive lines.
457
482
  ForceEqualSignAlignment: false
458
483
 
459
484
  Style/FileName:
460
- # File names listed in AllCops:Include are excluded by default. Add extra
485
+ # File names listed in `AllCops:Include` are excluded by default. Add extra
461
486
  # excludes here.
462
487
  Exclude: []
463
- # When true, requires that each source file should define a class or module
488
+ # When `true`, requires that each source file should define a class or module
464
489
  # with a name which matches the file name (converted to ... case).
465
490
  # It further expects it to be nested inside modules which match the names
466
491
  # of subdirectories in its path.
467
492
  ExpectMatchingDefinition: false
468
- # If non-nil, expect all source file names to match the following regex.
493
+ # If non-`nil`, expect all source file names to match the following regex.
469
494
  # Only the file name itself is matched, not the entire file path.
470
495
  # Use anchors as necessary if you want to match the entire name rather than
471
496
  # just a part of it.
@@ -474,6 +499,47 @@ Style/FileName:
474
499
  # report offending filenames for executable scripts (i.e. source
475
500
  # files with a shebang in the first line).
476
501
  IgnoreExecutableScripts: true
502
+ AllowedAcronyms:
503
+ - CLI
504
+ - DSL
505
+ - ACL
506
+ - API
507
+ - ASCII
508
+ - CPU
509
+ - CSS
510
+ - DNS
511
+ - EOF
512
+ - GUID
513
+ - HTML
514
+ - HTTP
515
+ - HTTPS
516
+ - ID
517
+ - IP
518
+ - JSON
519
+ - LHS
520
+ - QPS
521
+ - RAM
522
+ - RHS
523
+ - RPC
524
+ - SLA
525
+ - SMTP
526
+ - SQL
527
+ - SSH
528
+ - TCP
529
+ - TLS
530
+ - TTL
531
+ - UDP
532
+ - UI
533
+ - UID
534
+ - UUID
535
+ - URI
536
+ - URL
537
+ - UTF8
538
+ - VM
539
+ - XML
540
+ - XMPP
541
+ - XSRF
542
+ - XSS
477
543
 
478
544
  Style/FirstParameterIndentation:
479
545
  EnforcedStyle: special_for_inner_method_call_in_parentheses
@@ -486,10 +552,10 @@ Style/FirstParameterIndentation:
486
552
  # a parameter in a method call, then the inner parameter should be indented
487
553
  # relative to the inner method.
488
554
  - special_for_inner_method_call
489
- # Same as special_for_inner_method_call except that the special rule only
555
+ # Same as `special_for_inner_method_call` except that the special rule only
490
556
  # applies if the outer method call encloses its arguments in parentheses.
491
557
  - special_for_inner_method_call_in_parentheses
492
- # By default, the indentation width from Style/IndentationWidth is used
558
+ # By default, the indentation width from `Style/IndentationWidth` is used
493
559
  # But it can be overridden by setting this parameter
494
560
  IndentationWidth: ~
495
561
 
@@ -519,12 +585,15 @@ Style/FrozenStringLiteralComment:
519
585
  # string literal. If you run code against multiple versions of Ruby, it is
520
586
  # possible that this will create errors in Ruby 2.3.0+.
521
587
  - always
588
+ # `never` will enforce that the frozen string literal comment does not
589
+ # exist in a file.
590
+ - never
522
591
 
523
592
  # Built-in global variables are allowed by default.
524
593
  Style/GlobalVars:
525
594
  AllowedVariables: []
526
595
 
527
- # `MinBodyLength` defines the number of lines of the a body of an if / unless
596
+ # `MinBodyLength` defines the number of lines of the a body of an `if` or `unless`
528
597
  # needs to have to trigger this cop
529
598
  Style/GuardClause:
530
599
  MinBodyLength: 1
@@ -532,9 +601,14 @@ Style/GuardClause:
532
601
  Style/HashSyntax:
533
602
  EnforcedStyle: ruby19
534
603
  SupportedStyles:
604
+ # checks for 1.9 syntax (e.g. {a: 1}) for all symbol keys
535
605
  - ruby19
536
- - ruby19_no_mixed_keys
606
+ # checks for hash rocket syntax for all hashes
537
607
  - hash_rockets
608
+ # forbids mixed key syntaxes (e.g. {a: 1, :b => 2})
609
+ - no_mixed_keys
610
+ # enforces both ruby19 and no_mixed_keys styles
611
+ - ruby19_no_mixed_keys
538
612
  # Force hashes that have a symbol value to use hash rockets
539
613
  UseHashRocketsWithSymbolValues: false
540
614
  # Do not suggest { a?: 1 } over { :a? => 1 } in ruby19 style
@@ -577,13 +651,13 @@ Style/IndentArray:
577
651
  - special_inside_parentheses
578
652
  - consistent
579
653
  - align_brackets
580
- # By default, the indentation width from Style/IndentationWidth is used
654
+ # By default, the indentation width from `Style/IndentationWidth` is used
581
655
  # But it can be overridden by setting this parameter
582
656
  IndentationWidth: ~
583
657
 
584
658
  # Checks the indentation of assignment RHS, when on a different line from LHS
585
659
  Style/IndentAssignment:
586
- # By default, the indentation width from Style/IndentationWidth is used
660
+ # By default, the indentation width from `Style/IndentationWidth` is used
587
661
  # But it can be overridden by setting this parameter
588
662
  IndentationWidth: ~
589
663
 
@@ -605,7 +679,7 @@ Style/IndentHash:
605
679
  - special_inside_parentheses
606
680
  - consistent
607
681
  - align_braces
608
- # By default, the indentation width from Style/IndentationWidth is used
682
+ # By default, the indentation width from `Style/IndentationWidth` is used
609
683
  # But it can be overridden by setting this parameter
610
684
  IndentationWidth: ~
611
685
 
@@ -616,6 +690,12 @@ Style/Lambda:
616
690
  - lambda
617
691
  - literal
618
692
 
693
+ Style/SpaceInLambdaLiteral:
694
+ EnforcedStyle: require_no_space
695
+ SupportedStyles:
696
+ - require_no_space
697
+ - require_space
698
+
619
699
  Style/LambdaCall:
620
700
  EnforcedStyle: call
621
701
  SupportedStyles:
@@ -627,7 +707,7 @@ Style/Next:
627
707
  # replaced by next - with `skip_modifier_ifs` the modifier if like this one
628
708
  # are ignored: [1, 2].each { |a| return 'yes' if a == 1 }
629
709
  EnforcedStyle: skip_modifier_ifs
630
- # `MinBodyLength` defines the number of lines of the a body of an if / unless
710
+ # `MinBodyLength` defines the number of lines of the a body of an `if` or `unless`
631
711
  # needs to have to trigger this cop
632
712
  MinBodyLength: 3
633
713
  SupportedStyles:
@@ -648,6 +728,10 @@ Style/NumericPredicate:
648
728
  SupportedStyles:
649
729
  - predicate
650
730
  - comparison
731
+ # Exclude RSpec specs because assertions like `expect(1).to be > 0` cause
732
+ # false positives.
733
+ Exclude:
734
+ - 'spec/**/*'
651
735
 
652
736
  Style/MethodDefParentheses:
653
737
  EnforcedStyle: require_parentheses
@@ -656,6 +740,9 @@ Style/MethodDefParentheses:
656
740
  - require_no_parentheses
657
741
  - require_no_parentheses_except_multiline
658
742
 
743
+ Style/MethodCallWithArgsParentheses:
744
+ IgnoredMethods: []
745
+
659
746
  Style/MethodName:
660
747
  EnforcedStyle: snake_case
661
748
  SupportedStyles:
@@ -741,7 +828,7 @@ Style/MultilineOperationIndentation:
741
828
  SupportedStyles:
742
829
  - aligned
743
830
  - indented
744
- # By default, the indentation width from Style/IndentationWidth is used
831
+ # By default, the indentation width from `Style/IndentationWidth` is used
745
832
  # But it can be overridden by setting this parameter
746
833
  IndentationWidth: ~
747
834
 
@@ -771,6 +858,7 @@ Style/PercentLiteralDelimiters:
771
858
  PreferredDelimiters:
772
859
  '%': ()
773
860
  '%i': ()
861
+ '%I': ()
774
862
  '%q': ()
775
863
  '%Q': ()
776
864
  '%r': '{}'
@@ -782,8 +870,8 @@ Style/PercentLiteralDelimiters:
782
870
  Style/PercentQLiterals:
783
871
  EnforcedStyle: lower_case_q
784
872
  SupportedStyles:
785
- - lower_case_q # Use %q when possible, %Q when necessary
786
- - upper_case_q # Always use %Q
873
+ - lower_case_q # Use `%q` when possible, `%Q` when necessary
874
+ - upper_case_q # Always use `%Q`
787
875
 
788
876
  Style/PredicateName:
789
877
  # Predicate name prefixes.
@@ -796,7 +884,7 @@ Style/PredicateName:
796
884
  - is_
797
885
  - has_
798
886
  - have_
799
- # Predicate names which, despite having a blacklisted prefix, or no ?,
887
+ # Predicate names which, despite having a blacklisted prefix, or no `?`,
800
888
  # should still be accepted
801
889
  NameWhitelist:
802
890
  - is_a?
@@ -805,6 +893,12 @@ Style/PredicateName:
805
893
  Exclude:
806
894
  - 'spec/**/*'
807
895
 
896
+ Style/PreferredHashMethods:
897
+ EnforcedStyle: short
898
+ SupportedStyles:
899
+ - short
900
+ - verbose
901
+
808
902
  Style/RaiseArgs:
809
903
  EnforcedStyle: exploded
810
904
  SupportedStyles:
@@ -812,25 +906,30 @@ Style/RaiseArgs:
812
906
  - exploded # raise Exception, msg
813
907
 
814
908
  Style/RedundantReturn:
815
- # When true allows code like `return x, y`.
909
+ # When `true` allows code like `return x, y`.
816
910
  AllowMultipleReturnValues: false
817
911
 
818
- # Use / or %r around regular expressions.
912
+ # Use `/` or `%r` around regular expressions.
819
913
  Style/RegexpLiteral:
820
914
  EnforcedStyle: slashes
821
915
  # slashes: Always use slashes.
822
- # percent_r: Always use %r.
823
- # mixed: Use slashes on single-line regexes, and %r on multi-line regexes.
916
+ # percent_r: Always use `%r`.
917
+ # mixed: Use slashes on single-line regexes, and `%r` on multi-line regexes.
824
918
  SupportedStyles:
825
919
  - slashes
826
920
  - percent_r
827
921
  - mixed
828
- # If false, the cop will always recommend using %r if one or more slashes
922
+ # If `false`, the cop will always recommend using `%r` if one or more slashes
829
923
  # are found in the regexp string.
830
924
  AllowInnerSlashes: false
831
925
 
926
+ Style/SafeNavigation:
927
+ # Safe navigation may cause a statement to start returning `nil` in addition
928
+ # to whatever it used to return.
929
+ ConvertCodeThatCanStartToReturnNil: false
930
+
832
931
  Style/Semicolon:
833
- # Allow ; to separate several expressions on the same line.
932
+ # Allow `;` to separate several expressions on the same line.
834
933
  AllowAsExpressionSeparator: false
835
934
 
836
935
  Style/SignalException:
@@ -843,17 +942,17 @@ Style/SignalException:
843
942
  Style/SingleLineBlockParams:
844
943
  Methods:
845
944
  - reduce:
846
- - a
847
- - e
945
+ - acc
946
+ - elem
848
947
  - inject:
849
- - a
850
- - e
948
+ - acc
949
+ - elem
851
950
 
852
951
  Style/SingleLineMethods:
853
952
  AllowIfMethodIsEmpty: true
854
953
 
855
954
  Style/SpaceBeforeFirstArg:
856
- # When true, allows most uses of extra spacing if the intent is to align
955
+ # When `true`, allows most uses of extra spacing if the intent is to align
857
956
  # things with the previous or next line, not counting empty lines or comment
858
957
  # lines.
859
958
  AllowForAlignment: true
@@ -875,7 +974,7 @@ Style/StringLiterals:
875
974
  SupportedStyles:
876
975
  - single_quotes
877
976
  - double_quotes
878
- # If true, strings which span multiple lines using \ for continuation must
977
+ # If `true`, strings which span multiple lines using `\` for continuation must
879
978
  # use the same type of quotes on each line.
880
979
  ConsistentQuotesInMultiline: false
881
980
 
@@ -897,7 +996,7 @@ Style/StringMethods:
897
996
 
898
997
  Style/SpaceAroundBlockParameters:
899
998
  EnforcedStyleInsidePipes: no_space
900
- SupportedStyles:
999
+ SupportedStylesInsidePipes:
901
1000
  - space
902
1001
  - no_space
903
1002
 
@@ -908,7 +1007,7 @@ Style/SpaceAroundEqualsInParameterDefault:
908
1007
  - no_space
909
1008
 
910
1009
  Style/SpaceAroundOperators:
911
- # When true, allows most uses of extra spacing if the intent is to align
1010
+ # When `true`, allows most uses of extra spacing if the intent is to align
912
1011
  # with an operator on the previous or next line, not counting empty lines
913
1012
  # or comment lines.
914
1013
  AllowForAlignment: true
@@ -924,20 +1023,25 @@ Style/SpaceInsideBlockBraces:
924
1023
  SupportedStyles:
925
1024
  - space
926
1025
  - no_space
927
- # Valid values are: space, no_space
928
1026
  EnforcedStyleForEmptyBraces: no_space
1027
+ SupportedStylesForEmptyBraces:
1028
+ - space
1029
+ - no_space
929
1030
  # Space between { and |. Overrides EnforcedStyle if there is a conflict.
930
1031
  SpaceBeforeBlockParameters: true
931
1032
 
932
1033
  Style/SpaceInsideHashLiteralBraces:
933
1034
  EnforcedStyle: space
934
- EnforcedStyleForEmptyBraces: no_space
935
1035
  SupportedStyles:
936
1036
  - space
937
1037
  - no_space
938
1038
  # 'compact' normally requires a space inside hash braces, with the exception
939
1039
  # that successive left braces or right braces are collapsed together
940
1040
  - compact
1041
+ EnforcedStyleForEmptyBraces: no_space
1042
+ SupportedStylesForEmptyBraces:
1043
+ - space
1044
+ - no_space
941
1045
 
942
1046
  Style/SpaceInsideStringInterpolation:
943
1047
  EnforcedStyle: no_space
@@ -963,6 +1067,7 @@ Style/TernaryParentheses:
963
1067
  SupportedStyles:
964
1068
  - require_parentheses
965
1069
  - require_no_parentheses
1070
+ - require_parentheses_when_complex
966
1071
  AllowSafeAssignment: true
967
1072
 
968
1073
  Style/TrailingBlankLines:
@@ -977,7 +1082,7 @@ Style/TrailingCommaInArguments:
977
1082
  # If `consistent_comma`, the cop requires a comma after the last argument,
978
1083
  # for all parenthesized method calls with arguments.
979
1084
  EnforcedStyleForMultiline: no_comma
980
- SupportedStyles:
1085
+ SupportedStylesForMultiline:
981
1086
  - comma
982
1087
  - consistent_comma
983
1088
  - no_comma
@@ -988,7 +1093,7 @@ Style/TrailingCommaInLiteral:
988
1093
  # If `consistent_comma`, the cop requires a comma after the last item of all
989
1094
  # non-empty array and hash literals.
990
1095
  EnforcedStyleForMultiline: no_comma
991
- SupportedStyles:
1096
+ SupportedStylesForMultiline:
992
1097
  - comma
993
1098
  - consistent_comma
994
1099
  - no_comma
@@ -996,7 +1101,7 @@ Style/TrailingCommaInLiteral:
996
1101
  # TrivialAccessors requires exact name matches and doesn't allow
997
1102
  # predicated methods by default.
998
1103
  Style/TrivialAccessors:
999
- # When set to false the cop will suggest the use of accessor methods
1104
+ # When set to `false` the cop will suggest the use of accessor methods
1000
1105
  # in situations like:
1001
1106
  #
1002
1107
  # def name
@@ -1041,10 +1146,17 @@ Style/VariableName:
1041
1146
  - snake_case
1042
1147
  - camelCase
1043
1148
 
1149
+ Style/VariableNumber:
1150
+ EnforcedStyle: normalcase
1151
+ SupportedStyles:
1152
+ - snake_case
1153
+ - normalcase
1154
+ - non_integer
1155
+
1044
1156
  Style/WhileUntilModifier:
1045
1157
  MaxLineLength: 80
1046
1158
 
1047
- # WordArray enforces how array literals of word-like strings should be expressed.
1159
+ # `WordArray` enforces how array literals of word-like strings should be expressed.
1048
1160
  Style/WordArray:
1049
1161
  EnforcedStyle: percent
1050
1162
  SupportedStyles:
@@ -1052,21 +1164,22 @@ Style/WordArray:
1052
1164
  - percent
1053
1165
  # bracket style: ['word1', 'word2']
1054
1166
  - brackets
1055
- # The MinSize option causes the WordArray rule to be ignored for arrays
1167
+ # The `MinSize` option causes the `WordArray` rule to be ignored for arrays
1056
1168
  # smaller than a certain size. The rule is only applied to arrays
1057
- # whose element count is greater than or equal to MinSize.
1169
+ # whose element count is greater than or equal to `MinSize`.
1058
1170
  MinSize: 0
1059
- # The regular expression WordRegex decides what is considered a word.
1171
+ # The regular expression `WordRegex` decides what is considered a word.
1060
1172
  WordRegex: !ruby/regexp '/\A[\p{Word}\n\t]+\z/'
1061
1173
 
1062
1174
  ##################### Metrics ##################################
1063
1175
 
1064
1176
  Metrics/AbcSize:
1065
- # The ABC size is a calculated magnitude, so this number can be a Fixnum or
1177
+ # The ABC size is a calculated magnitude, so this number can be an Integer or
1066
1178
  # a Float.
1067
1179
  Max: 15
1068
1180
 
1069
1181
  Metrics/BlockNesting:
1182
+ CountBlocks: false
1070
1183
  Max: 3
1071
1184
 
1072
1185
  Metrics/ClassLength:
@@ -1090,11 +1203,23 @@ Metrics/LineLength:
1090
1203
  URISchemes:
1091
1204
  - http
1092
1205
  - https
1206
+ # The IgnoreCopDirectives option causes the LineLength rule to ignore cop
1207
+ # directives like '# rubocop: enable ...' when calculating a line's length.
1208
+ IgnoreCopDirectives: false
1209
+ # The IgnoredPatterns option is a list of !ruby/regexp and/or string
1210
+ # elements. Strings will be converted to Regexp objects. A line that matches
1211
+ # any regular expression listed in this option will be ignored by LineLength.
1212
+ IgnoredPatterns: []
1093
1213
 
1094
1214
  Metrics/MethodLength:
1095
1215
  CountComments: false # count full line comments?
1096
1216
  Max: 10
1097
1217
 
1218
+ Metrics/BlockLength:
1219
+ CountComments: false # count full line comments?
1220
+ Max: 25
1221
+ ExcludedMethods: []
1222
+
1098
1223
  Metrics/ParameterLists:
1099
1224
  Max: 5
1100
1225
  CountKeywordArgs: true
@@ -1115,8 +1240,8 @@ Lint/BlockAlignment:
1115
1240
  # The value `start_of_line` means it should be aligned with the whole
1116
1241
  # expression's starting line.
1117
1242
  # The value `either` means both are allowed.
1118
- AlignWith: either
1119
- SupportedStyles:
1243
+ EnforcedStyleAlignWith: either
1244
+ SupportedStylesAlignWith:
1120
1245
  - either
1121
1246
  - start_of_block
1122
1247
  - start_of_line
@@ -1124,14 +1249,14 @@ Lint/BlockAlignment:
1124
1249
  # Align ends correctly.
1125
1250
  Lint/EndAlignment:
1126
1251
  # The value `keyword` means that `end` should be aligned with the matching
1127
- # keyword (if, while, etc.).
1252
+ # keyword (`if`, `while`, etc.).
1128
1253
  # The value `variable` means that in assignments, `end` should be aligned
1129
1254
  # with the start of the variable on the left hand side of `=`. In all other
1130
1255
  # situations, `end` should still be aligned with the keyword.
1131
1256
  # The value `start_of_line` means that `end` should be aligned with the start
1132
1257
  # of the line which the matching keyword appears on.
1133
- AlignWith: keyword
1134
- SupportedStyles:
1258
+ EnforcedStyleAlignWith: keyword
1259
+ SupportedStylesAlignWith:
1135
1260
  - keyword
1136
1261
  - variable
1137
1262
  - start_of_line
@@ -1142,8 +1267,8 @@ Lint/DefEndAlignment:
1142
1267
  # The value `start_of_line` means that `end` should be aligned with method
1143
1268
  # calls like `private`, `public`, etc, if present in front of the `def`
1144
1269
  # keyword on the same line.
1145
- AlignWith: start_of_line
1146
- SupportedStyles:
1270
+ EnforcedStyleAlignWith: start_of_line
1271
+ SupportedStylesAlignWith:
1147
1272
  - start_of_line
1148
1273
  - def
1149
1274
  AutoCorrect: false
@@ -1192,6 +1317,14 @@ Rails/Date:
1192
1317
  - strict
1193
1318
  - flexible
1194
1319
 
1320
+ Rails/DynamicFindBy:
1321
+ Whitelist:
1322
+ - find_by_sql
1323
+
1324
+ Rails/EnumUniqueness:
1325
+ Include:
1326
+ - app/models/**/*.rb
1327
+
1195
1328
  Rails/Exit:
1196
1329
  Include:
1197
1330
  - app/**/*.rb
@@ -1212,6 +1345,10 @@ Rails/HasAndBelongsToMany:
1212
1345
  Include:
1213
1346
  - app/models/**/*.rb
1214
1347
 
1348
+ Rails/NotNullColumn:
1349
+ Include:
1350
+ - db/migrate/*.rb
1351
+
1215
1352
  Rails/Output:
1216
1353
  Include:
1217
1354
  - app/**/*.rb
@@ -1229,6 +1366,17 @@ Rails/RequestReferer:
1229
1366
  - referer
1230
1367
  - referrer
1231
1368
 
1369
+ Rails/ReversibleMigration:
1370
+ Include:
1371
+ - db/migrate/*.rb
1372
+
1373
+ Rails/SafeNavigation:
1374
+ # This will convert usages of `try` to use safe navigation as well as `try!`.
1375
+ # `try` and `try!` work slighly differently. `try!` and safe navigation will
1376
+ # both raise a `NoMethodError` if the receiver of the method call does not
1377
+ # implement the intended method. `try` will not raise an exception for this.
1378
+ ConvertTry: false
1379
+
1232
1380
  Rails/ScopeArgs:
1233
1381
  Include:
1234
1382
  - app/models/**/*.rb
@@ -1242,12 +1390,26 @@ Rails/TimeZone:
1242
1390
  - flexible
1243
1391
 
1244
1392
  Rails/UniqBeforePluck:
1245
- EnforcedMode: conservative
1246
- SupportedModes:
1393
+ EnforcedStyle: conservative
1394
+ SupportedStyles:
1247
1395
  - conservative
1248
1396
  - aggressive
1249
1397
  AutoCorrect: false
1250
1398
 
1399
+ Rails/SkipsModelValidations:
1400
+ Blacklist:
1401
+ - decrement!
1402
+ - decrement_counter
1403
+ - increment!
1404
+ - increment_counter
1405
+ - toggle!
1406
+ - touch
1407
+ - update_all
1408
+ - update_attribute
1409
+ - update_column
1410
+ - update_columns
1411
+ - update_counters
1412
+
1251
1413
  Rails/Validation:
1252
1414
  Include:
1253
1415
  - app/models/**/*.rb