chefstyle 0.6.0 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
data/config/upstream.yml CHANGED
@@ -55,13 +55,14 @@ AllCops:
55
55
  - '**/Vagabondfile'
56
56
  - '**/Vagrantfile'
57
57
  Exclude:
58
+ - 'node_modules/**/*'
58
59
  - 'vendor/**/*'
59
60
  # Default formatter will be used if no `-f/--format` option is given.
60
61
  DefaultFormatter: progress
61
- # Cop names are not displayed in offense messages by default. Change behavior
62
- # by overriding DisplayCopNames, or by giving the `-D/--display-cop-names`
62
+ # Cop names are displayed in offense messages by default. Change behavior
63
+ # by overriding DisplayCopNames, or by giving the `--no-display-cop-names`
63
64
  # option.
64
- DisplayCopNames: false
65
+ DisplayCopNames: true
65
66
  # Style guide URLs are not displayed in offense messages by default. Change
66
67
  # behavior by overriding `DisplayStyleGuide`, or by giving the
67
68
  # `-S/--display-style-guide` option.
@@ -489,6 +490,10 @@ Layout/SpaceBeforeBlockBraces:
489
490
  SupportedStyles:
490
491
  - space
491
492
  - no_space
493
+ EnforcedStyleForEmptyBraces: space
494
+ SupportedStylesForEmptyBraces:
495
+ - space
496
+ - no_space
492
497
 
493
498
  Layout/SpaceBeforeFirstArg:
494
499
  # When `true`, allows most uses of extra spacing if the intent is to align
@@ -496,6 +501,19 @@ Layout/SpaceBeforeFirstArg:
496
501
  # lines.
497
502
  AllowForAlignment: true
498
503
 
504
+ Layout/SpaceInsideArrayLiteralBrackets:
505
+ EnforcedStyle: no_space
506
+ SupportedStyles:
507
+ - space
508
+ - no_space
509
+ # 'compact' normally requires a space inside the brackets, with the exception
510
+ # that successive left brackets or right brackets are collapsed together
511
+ - compact
512
+ EnforcedStyleForEmptyBrackets: no_space
513
+ SupportedStylesForEmptyBrackets:
514
+ - space
515
+ - no_space
516
+
499
517
  Layout/SpaceInsideBlockBraces:
500
518
  EnforcedStyle: space
501
519
  SupportedStyles:
@@ -521,18 +539,162 @@ Layout/SpaceInsideHashLiteralBraces:
521
539
  - space
522
540
  - no_space
523
541
 
542
+ Layout/SpaceInsideReferenceBrackets:
543
+ EnforcedStyle: no_space
544
+ SupportedStyles:
545
+ - space
546
+ - no_space
547
+
524
548
  Layout/SpaceInsideStringInterpolation:
525
549
  EnforcedStyle: no_space
526
550
  SupportedStyles:
527
551
  - space
528
552
  - no_space
529
553
 
554
+ Layout/ClassStructure:
555
+ Categories:
556
+ module_inclusion:
557
+ - include
558
+ - prepend
559
+ - extend
560
+ ExpectedOrder:
561
+ - module_inclusion
562
+ - constants
563
+ - public_class_methods
564
+ - initializer
565
+ - public_methods
566
+ - protected_methods
567
+ - private_methods
568
+
569
+ Layout/Tab:
570
+ # By default, the indentation width from Layout/IndentationWidth is used
571
+ # But it can be overridden by setting this parameter
572
+ # It is used during auto-correction to determine how many spaces should
573
+ # replace each tab.
574
+ IndentationWidth: ~
575
+
530
576
  Layout/TrailingBlankLines:
531
577
  EnforcedStyle: final_newline
532
578
  SupportedStyles:
533
579
  - final_newline
534
580
  - final_blank_line
535
581
 
582
+ #################### Naming ##########################
583
+
584
+ Naming/FileName:
585
+ # File names listed in `AllCops:Include` are excluded by default. Add extra
586
+ # excludes here.
587
+ Exclude: []
588
+ # When `true`, requires that each source file should define a class or module
589
+ # with a name which matches the file name (converted to ... case).
590
+ # It further expects it to be nested inside modules which match the names
591
+ # of subdirectories in its path.
592
+ ExpectMatchingDefinition: false
593
+ # If non-`nil`, expect all source file names to match the following regex.
594
+ # Only the file name itself is matched, not the entire file path.
595
+ # Use anchors as necessary if you want to match the entire name rather than
596
+ # just a part of it.
597
+ Regex: ~
598
+ # With `IgnoreExecutableScripts` set to `true`, this cop does not
599
+ # report offending filenames for executable scripts (i.e. source
600
+ # files with a shebang in the first line).
601
+ IgnoreExecutableScripts: true
602
+ AllowedAcronyms:
603
+ - CLI
604
+ - DSL
605
+ - ACL
606
+ - API
607
+ - ASCII
608
+ - CPU
609
+ - CSS
610
+ - DNS
611
+ - EOF
612
+ - GUID
613
+ - HTML
614
+ - HTTP
615
+ - HTTPS
616
+ - ID
617
+ - IP
618
+ - JSON
619
+ - LHS
620
+ - QPS
621
+ - RAM
622
+ - RHS
623
+ - RPC
624
+ - SLA
625
+ - SMTP
626
+ - SQL
627
+ - SSH
628
+ - TCP
629
+ - TLS
630
+ - TTL
631
+ - UDP
632
+ - UI
633
+ - UID
634
+ - UUID
635
+ - URI
636
+ - URL
637
+ - UTF8
638
+ - VM
639
+ - XML
640
+ - XMPP
641
+ - XSRF
642
+ - XSS
643
+
644
+ Naming/HeredocDelimiterNaming:
645
+ Blacklist:
646
+ - END
647
+ - !ruby/regexp '/EO[A-Z]{1}/'
648
+
649
+ Naming/HeredocDelimiterCase:
650
+ EnforcedStyle: uppercase
651
+ SupportedStyles:
652
+ - lowercase
653
+ - uppercase
654
+
655
+ Naming/MethodName:
656
+ EnforcedStyle: snake_case
657
+ SupportedStyles:
658
+ - snake_case
659
+ - camelCase
660
+
661
+ Naming/PredicateName:
662
+ # Predicate name prefixes.
663
+ NamePrefix:
664
+ - is_
665
+ - has_
666
+ - have_
667
+ # Predicate name prefixes that should be removed.
668
+ NamePrefixBlacklist:
669
+ - is_
670
+ - has_
671
+ - have_
672
+ # Predicate names which, despite having a blacklisted prefix, or no `?`,
673
+ # should still be accepted
674
+ NameWhitelist:
675
+ - is_a?
676
+ # Method definition macros for dynamically generated methods.
677
+ MethodDefinitionMacros:
678
+ - define_method
679
+ - define_singleton_method
680
+ # Exclude Rspec specs because there is a strong convention to write spec
681
+ # helpers in the form of `have_something` or `be_something`.
682
+ Exclude:
683
+ - 'spec/**/*'
684
+
685
+ Naming/VariableName:
686
+ EnforcedStyle: snake_case
687
+ SupportedStyles:
688
+ - snake_case
689
+ - camelCase
690
+
691
+ Naming/VariableNumber:
692
+ EnforcedStyle: normalcase
693
+ SupportedStyles:
694
+ - snake_case
695
+ - normalcase
696
+ - non_integer
697
+
536
698
  #################### Style ###########################
537
699
 
538
700
  Style/Alias:
@@ -549,6 +711,9 @@ Style/AndOr:
549
711
  - always
550
712
  - conditionals
551
713
 
714
+ Style/AsciiComments:
715
+ AllowedChars: []
716
+
552
717
  # Checks if usage of `%()` or `%Q()` matches configuration.
553
718
  Style/BarePercentLiterals:
554
719
  EnforcedStyle: bare_percent
@@ -762,77 +927,6 @@ Style/EmptyMethod:
762
927
  - compact
763
928
  - expanded
764
929
 
765
- # Checks whether the source file has a utf-8 encoding comment or not
766
- # AutoCorrectEncodingComment must match the regex
767
- # /#.*coding\s?[:=]\s?(?:UTF|utf)-8/
768
- Style/Encoding:
769
- EnforcedStyle: never
770
- SupportedStyles:
771
- - when_needed
772
- - always
773
- - never
774
- AutoCorrectEncodingComment: '# encoding: utf-8'
775
-
776
- Style/FileName:
777
- # File names listed in `AllCops:Include` are excluded by default. Add extra
778
- # excludes here.
779
- Exclude: []
780
- # When `true`, requires that each source file should define a class or module
781
- # with a name which matches the file name (converted to ... case).
782
- # It further expects it to be nested inside modules which match the names
783
- # of subdirectories in its path.
784
- ExpectMatchingDefinition: false
785
- # If non-`nil`, expect all source file names to match the following regex.
786
- # Only the file name itself is matched, not the entire file path.
787
- # Use anchors as necessary if you want to match the entire name rather than
788
- # just a part of it.
789
- Regex: ~
790
- # With `IgnoreExecutableScripts` set to `true`, this cop does not
791
- # report offending filenames for executable scripts (i.e. source
792
- # files with a shebang in the first line).
793
- IgnoreExecutableScripts: true
794
- AllowedAcronyms:
795
- - CLI
796
- - DSL
797
- - ACL
798
- - API
799
- - ASCII
800
- - CPU
801
- - CSS
802
- - DNS
803
- - EOF
804
- - GUID
805
- - HTML
806
- - HTTP
807
- - HTTPS
808
- - ID
809
- - IP
810
- - JSON
811
- - LHS
812
- - QPS
813
- - RAM
814
- - RHS
815
- - RPC
816
- - SLA
817
- - SMTP
818
- - SQL
819
- - SSH
820
- - TCP
821
- - TLS
822
- - TTL
823
- - UDP
824
- - UI
825
- - UID
826
- - UUID
827
- - URI
828
- - URL
829
- - UTF8
830
- - VM
831
- - XML
832
- - XMPP
833
- - XSRF
834
- - XSS
835
-
836
930
  # Checks use of for or each in multiline loops.
837
931
  Style/For:
838
932
  EnforcedStyle: each
@@ -857,6 +951,7 @@ Style/FormatStringToken:
857
951
  - annotated
858
952
  # Prefer simple looking "template" style tokens like `%{name}`, `%{age}`
859
953
  - template
954
+ - unannotated
860
955
 
861
956
  Style/FrozenStringLiteralComment:
862
957
  EnforcedStyle: when_needed
@@ -898,11 +993,7 @@ Style/HashSyntax:
898
993
  # Do not suggest { a?: 1 } over { :a? => 1 } in ruby19 style
899
994
  PreferHashRocketsForNonAlnumEndingSymbols: false
900
995
 
901
- Style/IfUnlessModifier:
902
- MaxLineLength: 80
903
-
904
996
  Style/InverseMethods:
905
- Enabled: true
906
997
  # `InverseMethods` are methods that can be inverted by a not (`not` or `!`)
907
998
  # The relationship of inverse methods only needs to be defined in one direction.
908
999
  # Keys and values both need to be defined as symbols.
@@ -947,12 +1038,6 @@ Style/MethodDefParentheses:
947
1038
  - require_no_parentheses
948
1039
  - require_no_parentheses_except_multiline
949
1040
 
950
- Style/MethodName:
951
- EnforcedStyle: snake_case
952
- SupportedStyles:
953
- - snake_case
954
- - camelCase
955
-
956
1041
  # Checks the grouping of mixins (`include`, `extend`, `prepend`) in `class` and
957
1042
  # `module` bodies.
958
1043
  Style/MixinGrouping:
@@ -985,6 +1070,26 @@ Style/NegatedIf:
985
1070
  - prefix
986
1071
  - postfix
987
1072
 
1073
+ Style/NestedParenthesizedCalls:
1074
+ Whitelist:
1075
+ - be
1076
+ - be_a
1077
+ - be_an
1078
+ - be_between
1079
+ - be_falsey
1080
+ - be_kind_of
1081
+ - be_instance_of
1082
+ - be_truthy
1083
+ - be_within
1084
+ - eq
1085
+ - eql
1086
+ - end_with
1087
+ - include
1088
+ - match
1089
+ - raise_error
1090
+ - respond_to
1091
+ - start_with
1092
+
988
1093
  Style/Next:
989
1094
  # With `always` all conditions at the end of an iteration needs to be
990
1095
  # replaced by next - with `skip_modifier_ifs` the modifier if like this one
@@ -1057,26 +1162,6 @@ Style/PercentQLiterals:
1057
1162
  - lower_case_q # Use `%q` when possible, `%Q` when necessary
1058
1163
  - upper_case_q # Always use `%Q`
1059
1164
 
1060
- Style/PredicateName:
1061
- # Predicate name prefixes.
1062
- NamePrefix:
1063
- - is_
1064
- - has_
1065
- - have_
1066
- # Predicate name prefixes that should be removed.
1067
- NamePrefixBlacklist:
1068
- - is_
1069
- - has_
1070
- - have_
1071
- # Predicate names which, despite having a blacklisted prefix, or no `?`,
1072
- # should still be accepted
1073
- NameWhitelist:
1074
- - is_a?
1075
- # Exclude Rspec specs because there is a strong convention to write spec
1076
- # helpers in the form of `have_something` or `be_something`.
1077
- Exclude:
1078
- - 'spec/**/*'
1079
-
1080
1165
  Style/PreferredHashMethods:
1081
1166
  EnforcedStyle: short
1082
1167
  SupportedStyles:
@@ -1107,6 +1192,20 @@ Style/RegexpLiteral:
1107
1192
  # are found in the regexp string.
1108
1193
  AllowInnerSlashes: false
1109
1194
 
1195
+ Style/RescueStandardError:
1196
+ EnforcedStyle: explicit
1197
+ # implicit: Do not include the error class, `rescue`
1198
+ # explicit: Require an error class `rescue StandardError`
1199
+ SupportedStyles:
1200
+ - implicit
1201
+ - explicit
1202
+
1203
+ Style/ReturnNil:
1204
+ EnforcedStyle: return
1205
+ SupportedStyles:
1206
+ - return
1207
+ - return_nil
1208
+
1110
1209
  Style/SafeNavigation:
1111
1210
  # Safe navigation may cause a statement to start returning `nil` in addition
1112
1211
  # to whatever it used to return.
@@ -1258,22 +1357,6 @@ Style/TrivialAccessors:
1258
1357
  - to_s
1259
1358
  - to_sym
1260
1359
 
1261
- Style/VariableName:
1262
- EnforcedStyle: snake_case
1263
- SupportedStyles:
1264
- - snake_case
1265
- - camelCase
1266
-
1267
- Style/VariableNumber:
1268
- EnforcedStyle: normalcase
1269
- SupportedStyles:
1270
- - snake_case
1271
- - normalcase
1272
- - non_integer
1273
-
1274
- Style/WhileUntilModifier:
1275
- MaxLineLength: 80
1276
-
1277
1360
  # `WordArray` enforces how array literals of word-like strings should be expressed.
1278
1361
  Style/WordArray:
1279
1362
  EnforcedStyle: percent
@@ -1289,6 +1372,14 @@ Style/WordArray:
1289
1372
  # The regular expression `WordRegex` decides what is considered a word.
1290
1373
  WordRegex: !ruby/regexp '/\A[\p{Word}\n\t]+\z/'
1291
1374
 
1375
+ Style/YodaCondition:
1376
+ EnforcedStyle: all_comparison_operators
1377
+ SupportedStyles:
1378
+ # check all comparison operators
1379
+ - all_comparison_operators
1380
+ # check only equality operators: `!=` and `==`
1381
+ - equality_operators_only
1382
+
1292
1383
  #################### Metrics ###############################
1293
1384
 
1294
1385
  Metrics/AbcSize:
@@ -1398,6 +1489,16 @@ Lint/InheritException:
1398
1489
  - runtime_error
1399
1490
  - standard_error
1400
1491
 
1492
+ Lint/MissingCopEnableDirective:
1493
+ # Maximum number of consecutive lines the cop can be disabled for.
1494
+ # 0 allows only single-line disables
1495
+ # 1 would mean the maximum allowed is the following:
1496
+ # # rubocop:disable SomeCop
1497
+ # a = 1
1498
+ # # rubocop:enable SomeCop
1499
+ # .inf for any size
1500
+ MaximumRangeSize: .inf
1501
+
1401
1502
  Lint/SafeNavigationChain:
1402
1503
  Whitelist:
1403
1504
  - present?
@@ -1405,6 +1506,10 @@ Lint/SafeNavigationChain:
1405
1506
  - presence
1406
1507
  - try
1407
1508
 
1509
+ # Checks for shadowed arguments
1510
+ Lint/ShadowedArgument:
1511
+ IgnoreImplicitReferences: false
1512
+
1408
1513
  # Checks for unused block arguments
1409
1514
  Lint/UnusedBlockArgument:
1410
1515
  IgnoreEmptyBlocks: true
@@ -1436,6 +1541,10 @@ Rails/ActionFilter:
1436
1541
  Include:
1437
1542
  - app/controllers/**/*.rb
1438
1543
 
1544
+ Rails/CreateTableWithTimestamps:
1545
+ Include:
1546
+ - db/migrate/*.rb
1547
+
1439
1548
  Rails/Date:
1440
1549
  # The value `strict` disallows usage of `Date.today`, `Date.current`,
1441
1550
  # `Date#to_time` etc.
@@ -1447,6 +1556,12 @@ Rails/Date:
1447
1556
  - strict
1448
1557
  - flexible
1449
1558
 
1559
+ Rails/Delegate:
1560
+ # When set to true, using the target object as a prefix of the
1561
+ # method name without using the `delegate` method will be a
1562
+ # violation. When set to false, this case is legal.
1563
+ EnforceForPrefixed: true
1564
+
1450
1565
  Rails/DynamicFindBy:
1451
1566
  Whitelist:
1452
1567
  - find_by_sql
@@ -1475,6 +1590,18 @@ Rails/HasAndBelongsToMany:
1475
1590
  Include:
1476
1591
  - app/models/**/*.rb
1477
1592
 
1593
+ Rails/HasManyOrHasOneDependent:
1594
+ Include:
1595
+ - app/models/**/*.rb
1596
+
1597
+ Rails/InverseOf:
1598
+ Include:
1599
+ - app/models/**/*.rb
1600
+
1601
+ Rails/LexicallyScopedActionFilter:
1602
+ Include:
1603
+ - app/controllers/**/*.rb
1604
+
1478
1605
  Rails/NotNullColumn:
1479
1606
  Include:
1480
1607
  - db/migrate/*.rb
@@ -1502,7 +1629,7 @@ Rails/ReversibleMigration:
1502
1629
 
1503
1630
  Rails/SafeNavigation:
1504
1631
  # This will convert usages of `try` to use safe navigation as well as `try!`.
1505
- # `try` and `try!` work slighly differently. `try!` and safe navigation will
1632
+ # `try` and `try!` work slightly differently. `try!` and safe navigation will
1506
1633
  # both raise a `NoMethodError` if the receiver of the method call does not
1507
1634
  # implement the intended method. `try` will not raise an exception for this.
1508
1635
  ConvertTry: false
@@ -1526,6 +1653,12 @@ Rails/UniqBeforePluck:
1526
1653
  - aggressive
1527
1654
  AutoCorrect: false
1528
1655
 
1656
+ Rails/UnknownEnv:
1657
+ Environments:
1658
+ - development
1659
+ - test
1660
+ - production
1661
+
1529
1662
  Rails/SkipsModelValidations:
1530
1663
  Blacklist:
1531
1664
  - decrement!
@@ -1546,3 +1679,6 @@ Rails/Validation:
1546
1679
 
1547
1680
  Bundler/OrderedGems:
1548
1681
  TreatCommentsAsGroupSeparators: true
1682
+
1683
+ Gemspec/OrderedDependencies:
1684
+ TreatCommentsAsGroupSeparators: true