config/chefstyle.yml in chefstyle-0.3.1 vs config/chefstyle.yml in chefstyle-0.4.0
- old
+ new
@@ -30,36 +30,50 @@
Enabled: true
Lint/EndInMethod:
Enabled: true
Lint/EnsureReturn:
Enabled: true
+Lint/FloatOutOfRange:
+ Enabled: true
Lint/FormatParameterMismatch:
Enabled: true
+Lint/ImplicitStringConcatenation:
+ Enabled: true
Lint/InvalidCharacterLiteral:
Enabled: true
Lint/LiteralInCondition:
Enabled: true
Lint/LiteralInInterpolation:
Enabled: true
Lint/Loop:
Enabled: true
+Lint/NestedMethodDefinition:
+ Enabled: true
+Lint/NextWithoutAccumulator:
+ Enabled: true
Lint/NonLocalExitFromIterator:
Enabled: true
+Lint/RandOne:
+ Enabled: true
Lint/RequireParentheses:
Enabled: true
Lint/StringConversionInInterpolation:
Enabled: true
-Lint/UnneededDisable:
+Lint/UnderscorePrefixedVariableName:
Enabled: true
Lint/UnreachableCode:
Enabled: true
+Lint/UselessAccessModifier:
+ Enabled: true
Lint/UselessComparison:
Enabled: true
Lint/UselessElseWithoutRescue:
Enabled: true
Lint/UselessSetterCall:
Enabled: true
+Lint/Void:
+ Enabled: true
#
# Disabled Lint
#
@@ -74,40 +88,64 @@
Enabled: false
# We also decorate Exceptions a lot
Lint/RescueException:
Enabled: false
+# we have lots of not-insecure uses of eval
+Lint/Eval:
+ Enabled: false
+
+# disabling this will make it easier to stage chefstyle rollouts
+Lint/UnneededDisable:
+ Enabled: false
+
#
# Performance
#
-Performance/CaseCmp:
+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
+Performance/HashEachMethods:
+ Enabled: true
+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
#
# Rails
#
@@ -164,10 +202,12 @@
#
# Style
#
+Style/AccessModifierIndentation:
+ Enabled: true
Style/AlignHash:
Enabled: true
Style/AndOr:
Enabled: true
Style/ArrayJoin:
@@ -176,18 +216,22 @@
Enabled: true
Style/Attr:
Enabled: true
Style/BeginBlock:
Enabled: true
+Style/BlockDelimiters:
+ Enabled: true
Style/CharacterLiteral:
Enabled: true
Style/ClassMethods:
Enabled: true
Style/ColonMethodCall:
Enabled: true
Style/CommandLiteral:
Enabled: true
+Style/ConstantName:
+ Enabled: true
Style/ElseAlignment:
Enabled: true
Style/EmptyLineBetweenDefs:
Enabled: true
Style/EmptyLines:
@@ -206,12 +250,18 @@
Enabled: true
Style/FlipFlop:
Enabled: true
Style/For:
Enabled: true
+Style/FrozenStringLiteralComment:
+ Enabled: true
+Style/IfUnlessModifierOfIfUnless:
+ Enabled: true
Style/IfWithSemicolon:
Enabled: true
+Style/IndentAssignment:
+ Enabled: true
Style/IndentationConsistency:
Enabled: true
Style/IndentationWidth:
Enabled: true
Style/InfiniteLoop:
@@ -220,21 +270,33 @@
Enabled: true
Style/LambdaCall:
Enabled: true
Style/MethodDefParentheses:
Enabled: true
+Style/MultilineBlockLayout:
+ Enabled: true
+Style/MultilineIfThen:
+ Enabled: true
+Style/MultilineMethodDefinitionBraceLayout:
+ Enabled: true
Style/MultilineOperationIndentation:
Enabled: true
EnforcedStyle: indented
+Style/MultilineTernaryOperator:
+ Enabled: true
Style/NegatedWhile:
Enabled: true
Style/NestedModifier:
Enabled: true
Style/NestedTernaryOperator:
Enabled: true
Style/OneLineConditional:
Enabled: true
+Style/OpMethod:
+ Enabled: true
+Style/OptionalArguments:
+ Enabled: true
Style/ParenthesesAroundCondition:
Enabled: true
# - The chef source code predominantly uses {} for %,%i,%q,%Q,%r,%w,%W
# - The old 1.9 pickaxe book predominantly uses {} for %,%q,%Q,%r,%w,%W,%x
# - The chef source code does not use %x enough to determine a preference
@@ -252,10 +314,12 @@
'%w': '{}'
'%W': '{}'
'%x': '{}'
Style/PercentQLiterals:
Enabled: true
+Style/RedundantException:
+ Enabled: true
Style/RedundantFreeze:
Enabled: true
Style/RescueEnsureAlignment:
Enabled: true
# we only 'raise' and do not 'fail'
@@ -266,20 +330,26 @@
Enabled: true
Style/SpaceAfterComma:
Enabled: true
Style/SpaceAfterMethodName:
Enabled: true
+Style/SpaceAfterSemicolon:
+ Enabled: true
Style/SpaceAroundBlockParameters:
Enabled: true
Style/SpaceAroundEqualsInParameterDefault:
Enabled: true
Style/SpaceAroundOperators:
Enabled: true
Style/SpaceBeforeBlockBraces:
Enabled: true
+Style/SpaceBeforeComment:
+ Enabled: true
Style/SpaceBeforeFirstArg:
Enabled: true
+Style/SpaceBeforeSemicolon:
+ Enabled: true
Style/SpaceAroundKeyword:
Enabled: true
Style/SpaceInsideBlockBraces:
Enabled: true
Style/SpaceInsideHashLiteralBraces:
@@ -290,12 +360,16 @@
Enabled: true
# core chef community prefers double quotes over single quotes
Style/StringLiterals:
EnforcedStyle: double_quotes
Enabled: true
+Style/StructInheritance:
+ Enabled: true
Style/SymbolLiteral:
Enabled: true
+Style/StringMethods:
+ Enabled: true
Style/Tab:
Enabled: true
Style/TrailingBlankLines:
Enabled: true
Style/TrailingCommaInArguments:
@@ -310,14 +384,18 @@
Enabled: true
Style/UnneededCapitalW:
Enabled: true
#Style/UnneededPercentQ: # would like to enable this one but its buggy as of 0.35.1
# Enabled: true
+Style/VariableName:
+ Enabled: true
Style/WhenThen:
Enabled: true
Style/WhileUntilDo:
Enabled: true
+Style/WhileUntilModifier:
+ Enabled: true
Style/WordArray:
Enabled: true
#
# Disabled Style
@@ -365,6 +443,22 @@
Enabled: false
# This is overly aggressive and autofix broke stuff, would need to exclude classes
# - https://github.com/chef/chef/pull/4541
Style/TrivialAccessors:
+ Enabled: false
+
+# Not a lot of offenses and this seems to catch code that looks otherwise fine to my eye
+Style/MultilineBlockChain:
+ Enabled: false
+
+# We see nothing at all wrong with a trailing `rescue nil`
+Style/RescueModifier:
+ Enabled: false
+
+# Resulted in a bit of a bikeshed over names with unicode chars vs silently hidden unicode chars in comments
+Style/AsciiComments:
+ Enabled: false
+
+# Parens around ternaries often make them more readable and reduces cognitive load over operator precidence
+Style/TernaryParentheses:
Enabled: false