config/cookstyle.yml in cookstyle-4.0.0 vs config/cookstyle.yml in cookstyle-5.0.0
- old
+ new
@@ -1,11 +1,56 @@
AllCops:
TargetRubyVersion: 2.4
Exclude:
- vendor/**/*
- Guardfile
+ ChefAttributes:
+ Patterns:
+ - attributes/.*\.rb
+ ChefDefinitions:
+ Patterns:
+ - definitions/.*\.rb
+ ChefLibraries:
+ Patterns:
+ - libraries/.*\.rb
+ ChefMetadata:
+ Patterns:
+ - metadata\.rb
+ ChefProviders:
+ Patterns:
+ - providers/.*\.rb
+ ChefRecipes:
+ Patterns:
+ - recipes/.*\.rb
+ ChefResources:
+ Patterns:
+ - resources/.*\.rb
+Chef/AttributeKeys:
+ Description: Check which style of keys are used to access node attributes.
+ Enabled: true
+ EnforcedStyle: strings
+ SupportedStyles:
+ - strings
+ - symbols
+
+Chef/FileMode:
+ Description: Use strings to represent file modes in Chef resources
+ Enabled: true
+
+Chef/ServiceResource:
+ Description: Use a service resource to start and stop services
+ Enabled: true
+
+Chef/CopyrightCommentFormat:
+ Description: Properly format copyright dates in comment blocks and ensure dates are up to date
+ Enabled: false
+
+Chef/CommentFormat:
+ Description: Use Chef's unique format for comment headers
+ Enabled: true
+
#### The base rubocop 0.37 enabled.yml file we started with ####
Layout/AccessModifierIndentation:
Enabled: true
Naming/AccessorMethodName:
@@ -94,26 +139,22 @@
Enabled: true
Style/EvenOdd:
Enabled: true
Layout/ExtraSpacing:
Enabled: true
-Style/FrozenStringLiteralComment:
- Enabled: true
Layout/InitialIndentation:
Enabled: true
Layout/FirstParameterIndentation:
Enabled: true
-Style/FlipFlop:
+Lint/FlipFlop:
Enabled: true
Style/For:
Enabled: true
Style/FormatString:
Enabled: true
Style/GlobalVars:
Enabled: true
-Style/GuardClause:
- Enabled: true
Style/HashSyntax:
Enabled: true
Style/IfInsideElse:
Enabled: true
Style/IfWithSemicolon:
@@ -188,12 +229,10 @@
Enabled: true
Style/ParallelAssignment:
Enabled: true
Style/ParenthesesAroundCondition:
Enabled: true
-Style/PercentLiteralDelimiters:
- Enabled: true
Style/PercentQLiterals:
Enabled: true
Style/PerlBackrefs:
Enabled: true
Naming/PredicateName:
@@ -276,12 +315,10 @@
Enabled: true
Style/StructInheritance:
Enabled: true
Style/SymbolLiteral:
Enabled: true
-Style/SymbolProc:
- Enabled: true
Layout/Tab:
Enabled: true
Layout/TrailingBlankLines:
Enabled: true
Style/TrailingCommaInArguments:
@@ -408,51 +445,10 @@
Enabled: true
Lint/UselessSetterCall:
Enabled: true
Lint/Void:
Enabled: true
-Performance/Casecmp:
- Enabled: true
-Performance/CaseWhenSplat:
- Enabled: true
-Performance/Count:
- Enabled: true
-Performance/Detect:
- Enabled: true
-Performance/DoubleStartEndWith:
- Enabled: true
-Performance/EndWith:
- Enabled: true
-Performance/FixedSize:
- Enabled: true
-Performance/FlatMap:
- Enabled: true
- EnabledForFlattenWithoutParams: false
-Performance/LstripRstrip:
- Enabled: true
-Performance/RangeInclude:
- Enabled: true
-Performance/RedundantBlockCall:
- Enabled: true
-Performance/RedundantMatch:
- Enabled: true
-Performance/RedundantMerge:
- Enabled: true
-Performance/RedundantSortBy:
- Enabled: true
-Performance/ReverseEach:
- Enabled: true
-Performance/Sample:
- Enabled: true
-Performance/Size:
- Enabled: true
-Performance/StartWith:
- Enabled: true
-Performance/StringReplacement:
- Enabled: true
-Performance/TimesMap:
- Enabled: true
##### Additional rules we enable/disable over the rubocop 0.37 rules ago #####
Layout/AlignParameters:
Enabled: false
@@ -572,11 +568,12 @@
Style/FrozenStringLiteralComment:
Enabled: false
# maintain the previous array behavior in previous cookstyle releases
Style/PercentLiteralDelimiters:
- PreferredDelimiters:
+ Enabled: true
+ PreferredDelimiters:
'%': ()
'%i': ()
'%I': ()
'%q': ()
'%Q': ()
@@ -671,14 +668,11 @@
# get people on a much simpler ruby 2.4 way of doing things
Style/UnpackFirst:
Enabled: true
-# simplify how you get the min or max of an array
-Performance/UnneededSort:
- Enable: true
-
Style/SymbolProc:
+ Enabled: true
# A list of method names to be ignored by the check.
# The names should be fairly unique, otherwise you'll end up ignoring lots of code.
IgnoredMethods:
- lazy