Upgrading rubocop 0.24 to 0.25
Breaking0.24.1 โ 0.25.0Breaking1Platform1New12Fixed14
BreakingUpgrade verdict
1 breaking change and a platform requirement change.
In plain terms
- Several style checks now live under a new Metrics group, so configuration keys for them change.
- RuboCop no longer runs on Ruby 1.9.2. You need Ruby 1.9.3 or later.
Must act 2 items need code or config changes
Ruby requirement changed in 0.25.0: >= 1.9.2 โ >= 1.9.3.
What you must change
Breaking1
Creates the Metrics namespace and moves some Style cops there, such as ClassLength and MethodLength.
MetricsStyleClassLengthMethodLengthPlatform1
Drops support for Ruby 1.9.2; Ruby 1.9.3 or newer is now required.
API changes
Generated by DepDelta from published Ruby source. Not mixed with prose notes.
- removed:
method ProcessedSource.raw_lines() - added:
const ProcessedSource.STRING_SOURCE_NAME - added:
property ProcessedSource.raw_source: reader
- removed:
method AutocorrectUnlessChangingAST.rewrite_node(_) - removed:
method CheckMethods.on_def(_) - removed:
method CheckMethods.on_defs(_) - removed:
method CodeLength.check(_, *) - removed:
method ConfigurableNaming.after_dot(_, _, _) - removed:
method ConfigurableNaming.check(_, _) - removed:
method ConfigurableNaming.matches_config?(_) - removed:
method Cop.exclude_file?(_) - removed:
method Cop.include_file?(_) - removed:
method IfThenElse.check(_) - removed:
method IfThenElse.on_if(_) - removed:
method IfThenElse.on_unless(_) - removed:
method NegativeConditional.check(_) - removed:
method StatementModifier.check(_, _) - removed:
module CheckMethods - removed:
module IfThenElse - changed:
method StatementModifier.body_has_comment?(_, _) โ method StatementModifier.body_has_comment?(_) - added:
const StringHelp.ESCAPED_CHAR_REGEXP - added:
method CodeLength.check_code_length(_, *) - added:
method ConfigurableNaming.check_name(_, _, _) - added:
method ConfigurableNaming.valid_name?(_) - added:
method NegativeConditional.check_negative_conditional(_) - added:
method OnMethod.on_def(_) - added:
method OnMethod.on_defs(_) - added:
method OnNormalIfUnless.invoke_hook_for_normal_if_unless(_) - added:
method OnNormalIfUnless.on_if(_) - added:
method OnNormalIfUnless.on_unless(_) - added:
method StatementModifier.fit_within_line_as_modifier_form?(_) - added:
module MethodComplexity - added:
module Metrics - added:
module OnMethod - added:
module OnNormalIfUnless - added:
static method Util.begins_its_line?(_)
- added:
const Debugger.PRY_REMOTE_NODE - added:
method DefEndAlignment.on_method(_, _, _, _)
- added:
class BlockNesting < Cop - added:
class ClassLength < Cop - added:
class CyclomaticComplexity < Cop - added:
class LineLength < Cop - added:
class MethodLength < Cop - added:
class ParameterLists < Cop - added:
class PerceivedComplexity < Cop - added:
const BlockNesting.NESTING_BLOCKS - added:
const CyclomaticComplexity.COUNTED_NODES - added:
const CyclomaticComplexity.MSG - added:
const LineLength.MSG - added:
const ParameterLists.MSG - added:
const PerceivedComplexity.COUNTED_NODES - added:
const PerceivedComplexity.MSG - added:
method BlockNesting.investigate(_) - added:
method ClassLength.on_class(_) - added:
method LineLength.allow_uri?() - added:
method LineLength.allowed_uri_position?(_, _) - added:
method LineLength.find_excessive_uri_range(_) - added:
method LineLength.investigate(_) - added:
method LineLength.match_uris(_) - added:
method LineLength.max() - added:
method LineLength.valid_uri?(_) - added:
method ParameterLists.on_args(_)
- added:
class Brackets - added:
constructor Brackets(_, _, _) - added:
method Brackets.left_side?(_) - added:
method Brackets.right_side?(_) - added:
property Brackets.kind: reader
- removed:
class BlockNesting < Cop - removed:
class ClassLength < Cop - removed:
class CyclomaticComplexity < Cop - removed:
class LineLength < Cop - removed:
class MethodLength < Cop - removed:
class ParameterLists < Cop - removed:
const BlockNesting.NESTING_BLOCKS - removed:
const CyclomaticComplexity.DECISION_POINT_NODES - removed:
const CyclomaticComplexity.MSG - removed:
const LineLength.MSG - removed:
const ParameterLists.MSG - removed:
method BlockNesting.investigate(_) - removed:
method ClassLength.on_class(_) - removed:
method DefWithParentheses.check(_, _, _, _) - removed:
method IfUnlessModifier.error_message(_) - removed:
method IfWithSemicolon.error_message(_) - removed:
method IfWithSemicolon.offending_line(_) - removed:
method IndentationWidth.check(_, _, _, _) - removed:
method LineLength.allow_uri?() - removed:
method LineLength.allowed_uri_position?(_, _) - removed:
method LineLength.find_excessive_uri_range(_) - removed:
method LineLength.investigate(_) - removed:
method LineLength.match_uris(_) - removed:
method LineLength.max() - removed:
method LineLength.valid_uri?(_) - removed:
method MethodDefParentheses.check(_, _, _, _) - removed:
method MethodName.name_of_instance_method(_) - removed:
method MethodName.name_of_singleton_method(_) - removed:
method MultilineIfThen.error_message(_) - removed:
method MultilineIfThen.offending_line(_) - removed:
method OneLineConditional.error_message(_) - removed:
method OneLineConditional.offending_line(_) - removed:
method ParameterLists.on_args(_) - removed:
method RedundantBegin.check(_, _, _, _) - removed:
method SpaceAfterMethodName.check(_, _, _, _) - removed:
method VariableName.message(_) - removed:
method VariableName.name_of_setter(_) - removed:
method VariableName.name_of_variable(_) - changed:
method RescueModifier.check(_, _, _, _) โ method RescueModifier.check(_) - added:
class BarePercentLiterals < Cop - added:
class BlockEndNewline < Cop - added:
class MultilineBlockLayout < Cop - added:
class PercentQLiterals < Cop - added:
const BarePercentLiterals.MSG - added:
const BlockEndNewline.MSG - added:
const IfWithSemicolon.MSG - added:
const MultilineBlockLayout.MSG - added:
const OneLineConditional.MSG - added:
method AndOr.on_if(_) - added:
method AndOr.on_until(_) - added:
method AndOr.on_while(_) - added:
method BarePercentLiterals.on_dstr(_) - added:
method BarePercentLiterals.on_str(_) - added:
method BlockEndNewline.autocorrect(_) - added:
method BlockEndNewline.indentation_of_block_start_line(_) - added:
method BlockEndNewline.on_block(_) - added:
method DefWithParentheses.on_method(_, _, _, _) - added:
method EmptyLinesAroundAccessModifier.autocorrect(_) - added:
method IfUnlessModifier.message(_) - added:
method IfWithSemicolon.on_normal_if_unless(_) - added:
method IndentationWidth.on_method(_, _, _, _) - added:
method MethodDefParentheses.on_method(_, _, _, _) - added:
method MultilineBlockLayout.autocorrect(_) - added:
method MultilineBlockLayout.on_block(_) - added:
method MultilineIfThen.message(_) - added:
method MultilineIfThen.on_normal_if_unless(_) - added:
method OneLineConditional.on_normal_if_unless(_) - added:
method PercentQLiterals.on_str(_) - added:
method RedundantBegin.on_method(_, _, _, _) - added:
method RescueModifier.on_method(_, _, _, _) - added:
method SpaceAfterMethodName.on_method(_, _, _, _) - added:
method UnneededPercentQ.on_regexp(_) - added:
method VariableInterpolation.on_regexp(_) - added:
method VariableInterpolation.on_xstr(_)