config/default.yml in rubocop-0.88.0 vs config/default.yml in rubocop-0.89.0
- old
+ new
@@ -208,13 +208,14 @@
ConsiderPunctuation: false
Include:
- '**/*.gemspec'
Gemspec/RequiredRubyVersion:
- Description: 'Checks that `required_ruby_version` of gemspec and `TargetRubyVersion` of .rubocop.yml are equal.'
+ Description: 'Checks that `required_ruby_version` of gemspec is specified and equal to `TargetRubyVersion` of .rubocop.yml.'
Enabled: true
VersionAdded: '0.52'
+ VersionChanged: '0.89'
Include:
- '**/*.gemspec'
Gemspec/RubyVersionGlobalsUsage:
Description: Checks usage of RUBY_VERSION in gemspec.
@@ -1232,11 +1233,11 @@
# Space between `{` and `|`. Overrides `EnforcedStyle` if there is a conflict.
SpaceBeforeBlockParameters: true
Layout/SpaceInsideHashLiteralBraces:
Description: "Use spaces inside hash literal braces - or don't."
- StyleGuide: '#spaces-operators'
+ StyleGuide: '#spaces-braces'
Enabled: true
VersionAdded: '0.49'
EnforcedStyle: space
SupportedStyles:
- space
@@ -1353,10 +1354,16 @@
Lint/BigDecimalNew:
Description: '`BigDecimal.new()` is deprecated. Use `BigDecimal()` instead.'
Enabled: true
VersionAdded: '0.53'
+Lint/BinaryOperatorWithIdenticalOperands:
+ Description: 'This cop checks for places where binary operator has identical operands.'
+ Enabled: pending
+ Safe: false
+ VersionAdded: '0.89'
+
Lint/BooleanSymbol:
Description: 'Check for `:true` and `:false` symbols.'
Enabled: true
Safe: false
VersionAdded: '0.50'
@@ -1418,20 +1425,31 @@
Lint/DuplicateMethods:
Description: 'Check for duplicate method definitions.'
Enabled: true
VersionAdded: '0.29'
+Lint/DuplicateRescueException:
+ Description: 'Checks that there are no repeated exceptions used in `rescue` expressions.'
+ Enabled: pending
+ VersionAdded: '0.89'
+
Lint/EachWithObjectArgument:
Description: 'Check for immutable argument given to each_with_object.'
Enabled: true
VersionAdded: '0.31'
Lint/ElseLayout:
Description: 'Check for odd code arrangement in an else block.'
Enabled: true
VersionAdded: '0.17'
+Lint/EmptyConditionalBody:
+ Description: 'This cop checks for the presence of `if`, `elsif` and `unless` branches without a body.'
+ Enabled: 'pending'
+ AllowComments: true
+ VersionAdded: '0.89'
+
Lint/EmptyEnsure:
Description: 'Checks for empty ensure block.'
Enabled: true
VersionAdded: '0.10'
VersionChanged: '0.48'
@@ -1471,10 +1489,16 @@
Description: 'Checks for flip-flops.'
StyleGuide: '#no-flip-flops'
Enabled: true
VersionAdded: '0.16'
+Lint/FloatComparison:
+ Description: 'Checks for the presence of precise comparison of floating point numbers.'
+ StyleGuide: '#float-comparison'
+ Enabled: pending
+ VersionAdded: '0.89'
+
Lint/FloatOutOfRange:
Description: >-
Catches floating-point literals too large or small for Ruby to
represent.
Enabled: true
@@ -1518,11 +1542,11 @@
- standard_error
Lint/InterpolationCheck:
Description: 'Raise warning for interpolation in single q strs.'
Enabled: true
- SafeAutoCorrect: false
+ Safe: false
VersionAdded: '0.50'
VersionChanged: '0.87'
Lint/LiteralAsCondition:
Description: 'Checks of literals used in conditions.'
@@ -1540,10 +1564,11 @@
Use Kernel#loop with break rather than begin/end/until or
begin/end/while for post-loop tests.
StyleGuide: '#loop-with-break'
Enabled: true
VersionAdded: '0.9'
+ VersionChanged: '0.89'
Lint/MissingCopEnableDirective:
Description: 'Checks for a `# rubocop:enable` after `# rubocop:disable`.'
Enabled: true
VersionAdded: '0.52'
@@ -1554,10 +1579,17 @@
# a = 1
# # rubocop:enable SomeCop
# .inf for any size
MaximumRangeSize: .inf
+Lint/MissingSuper:
+ Description: >-
+ This cop checks for the presence of constructors and lifecycle callbacks
+ without calls to `super`'.
+ Enabled: pending
+ VersionAdded: '0.89'
+
Lint/MixedRegexpCaptureTypes:
Description: 'Do not mix named captures and numbered captures in a Regexp literal.'
Enabled: pending
VersionAdded: '0.85'
@@ -1606,10 +1638,16 @@
Lint/OrderedMagicComments:
Description: 'Checks the proper ordering of magic comments and whether a magic comment is not placed before a shebang.'
Enabled: true
VersionAdded: '0.53'
+Lint/OutOfRangeRegexpRef:
+ Description: 'Checks for out of range reference for Regexp because it always returns nil.'
+ Enabled: pending
+ Safe: false
+ VersionAdded: '0.89'
+
Lint/ParenthesesAsGroupedExpression:
Description: >-
Checks for method calls with a space before the opening
parenthesis.
StyleGuide: '#parens-no-spaces'
@@ -1756,10 +1794,15 @@
Description: 'Grant script file execute permission.'
Enabled: true
VersionAdded: '0.49'
VersionChanged: '0.50'
+Lint/SelfAssignment:
+ Description: 'Checks for self-assignments.'
+ Enabled: pending
+ VersionAdded: '0.89'
+
Lint/SendWithMixinArgument:
Description: 'Checks for `send` method when using mixin.'
Enabled: true
VersionAdded: '0.75'
@@ -1806,10 +1849,15 @@
Lint/ToJSON:
Description: 'Ensure #to_json includes an optional argument.'
Enabled: true
VersionAdded: '0.66'
+Lint/TopLevelReturnWithArgument:
+ Description: 'This cop detects top level return statements with argument.'
+ Enabled: 'pending'
+ VersionAdded: '0.89'
+
Lint/UnderscorePrefixedVariableName:
Description: 'Do not use prefix `_` for a variable that is used.'
Enabled: true
VersionAdded: '0.21'
AllowKeywordBlockArguments: false
@@ -1822,10 +1870,15 @@
Lint/UnreachableCode:
Description: 'Unreachable code.'
Enabled: true
VersionAdded: '0.9'
+Lint/UnreachableLoop:
+ Description: 'This cop checks for loops that will have at most one iteration.'
+ Enabled: pending
+ VersionAdded: '0.89'
+
Lint/UnusedBlockArgument:
Description: 'Checks for unused block arguments.'
StyleGuide: '#underscore-unused-vars'
Enabled: true
VersionAdded: '0.21'
@@ -1871,15 +1924,10 @@
Description: 'Checks for useless assignment to a local variable.'
StyleGuide: '#underscore-unused-vars'
Enabled: true
VersionAdded: '0.11'
-Lint/UselessComparison:
- Description: 'Checks for comparison of something with itself.'
- Enabled: true
- VersionAdded: '0.11'
-
Lint/UselessElseWithoutRescue:
Description: 'Checks for useless `else` in `begin..end` without `rescue`.'
Enabled: true
VersionAdded: '0.17'
@@ -1909,11 +1957,11 @@
VersionAdded: '0.27'
VersionChanged: '0.81'
# The ABC size is a calculated magnitude, so this number can be an Integer or
# a Float.
IgnoredMethods: []
- Max: 15
+ Max: 17
Metrics/BlockLength:
Description: 'Avoid long blocks with many lines.'
Enabled: true
VersionAdded: '0.44'
@@ -1991,11 +2039,11 @@
human reader.
Enabled: true
VersionAdded: '0.25'
VersionChanged: '0.81'
IgnoredMethods: []
- Max: 7
+ Max: 8
################## Migration #############################
Migration/DepartmentName:
Description: >-
@@ -2350,10 +2398,11 @@
Style/ArrayCoercion:
Description: >-
Use Array() instead of explicit Array check or [*var], when dealing
with a variable you want to treat as an Array, but you're not certain it's an array.
StyleGuide: '#array-coercion'
+ Safe: false
Enabled: 'pending'
VersionAdded: '0.88'
Style/ArrayJoin:
Description: 'Use Array#join instead of Array#*.'
@@ -2525,10 +2574,11 @@
Style/CaseEquality:
Description: 'Avoid explicit use of the case equality operator(===).'
StyleGuide: '#no-case-equality'
Enabled: true
VersionAdded: '0.9'
+ VersionChanged: '0.89'
# If AllowOnConstant is enabled, the cop will ignore violations when the receiver of
# the case equality operator is a constant.
#
# # bad
# /string/ === "string"
@@ -2878,10 +2928,20 @@
Style/ExpandPathArguments:
Description: "Use `expand_path(__dir__)` instead of `expand_path('..', __FILE__)`."
Enabled: true
VersionAdded: '0.53'
+Style/ExplicitBlockArgument:
+ Description: >-
+ Consider using explicit block argument to avoid writing block literal
+ that just passes its arguments to another block.
+ StyleGuide: '#block-argument'
+ Enabled: pending
+ # May change the yielding arity.
+ Safe: false
+ VersionAdded: '0.89'
+
Style/ExponentialNotation:
Description: 'When using exponential notation, favor a mantissa between 1 (inclusive) and 10 (exclusive).'
StyleGuide: '#exponential-notation'
Enabled: pending
VersionAdded: '0.82'
@@ -2961,10 +3021,16 @@
# `never` will enforce that the frozen string literal comment does not
# exist in a file.
- never
Safe: false
+Style/GlobalStdStream:
+ Description: 'Enforces the use of `$stdout/$stderr/$stdin` instead of `STDOUT/STDERR/STDIN`.'
+ StyleGuide: '#global-stdout'
+ Enabled: pending
+ VersionAdded: '0.89'
+
Style/GlobalVars:
Description: 'Do not introduce global variables.'
StyleGuide: '#instance-vars'
Reference: 'https://www.zenspider.com/ruby/quickref.html'
Enabled: true
@@ -3216,16 +3282,10 @@
SupportedStyles:
- require_parentheses
- require_no_parentheses
- require_no_parentheses_except_multiline
-Style/MethodMissingSuper:
- Description: Checks for `method_missing` to call `super`.
- StyleGuide: '#no-method-missing'
- Enabled: true
- VersionAdded: '0.56'
-
Style/MinMax:
Description: >-
Use `Enumerable#minmax` instead of `Enumerable#min`
and `Enumerable#max` in conjunction.
Enabled: true
@@ -3563,10 +3623,17 @@
Enabled: true
Safe: false
VersionAdded: '0.33'
VersionChanged: '0.83'
+Style/OptionalBooleanParameter:
+ Description: 'Use keyword arguments when defining method with boolean argument.'
+ StyleGuide: '#boolean-keyword-arguments'
+ Enabled: pending
+ Safe: false
+ VersionAdded: '0.89'
+
Style/OrAssignment:
Description: 'Recommend usage of double pipe equals (||=) where applicable.'
StyleGuide: '#double-pipe-for-uninit'
Enabled: true
VersionAdded: '0.50'
@@ -3881,10 +3948,16 @@
SupportedStyles:
- only_raise
- only_fail
- semantic
+Style/SingleArgumentDig:
+ Description: 'Avoid using single argument dig method.'
+ Enabled: pending
+ VersionAdded: '0.89'
+ Safe: false
+
Style/SingleLineBlockParams:
Description: 'Enforces the names of some block params.'
Enabled: false
VersionAdded: '0.16'
VersionChanged: '0.47'
@@ -3935,9 +4008,16 @@
Style/StderrPuts:
Description: 'Use `warn` instead of `$stderr.puts`.'
StyleGuide: '#warn'
Enabled: true
VersionAdded: '0.51'
+
+Style/StringConcatenation:
+ Description: 'Checks for places where string concatenation can be replaced with string interpolation.'
+ StyleGuide: '#string-interpolation'
+ Enabled: pending
+ Safe: false
+ VersionAdded: '0.89'
Style/StringHashKeys:
Description: 'Prefer symbols instead of strings as hash keys.'
StyleGuide: '#symbols-as-keys'
Enabled: false