Upgrading rubocop 0.46 to 0.47
Breaking0.46.0 → 0.47.1Breaking3New18Changed5Fixed27Other1
BreakingUpgrade verdict
3 breaking changes.
In plain terms
- The old cop name no longer exists, so configurations using it must be updated.
- The old cop name no longer exists, so configurations using it must be updated.
- Some configuration keys were renamed, so existing configs using the old names must be updated.
Must act 3 items need code or config changes
What you must change
Breaking3
Renames MethodCallParentheses to MethodCallWithoutArgsParentheses.
MethodCallParenthesesMethodCallWithoutArgsParenthesesRenames Lint/Eval to Security/Eval.
Lint/EvalSecurity/EvalAdds validation for supported styles other than EnforcedStyle and renames AlignWith, IndentWhenRelativeTo and EnforcedMode configurations.
AlignWithIndentWhenRelativeToEnforcedModeEnforcedStyleAPI changes
Generated by DepDelta from published Ruby source. Not mixed with prose notes.
- added:
method CopHelper.autocorrect_source_with_loop(_, _, _ = …)
- removed:
class Node < Parser::AST::Node - removed:
const Node.BASIC_LITERALS - removed:
const Node.COMPARISON_OPERATORS - removed:
const Node.COMPOSITE_LITERALS - removed:
const Node.FALSEY_LITERALS - removed:
const Node.IMMUTABLE_LITERALS - removed:
const Node.KEYWORDS - removed:
const Node.LITERALS - removed:
const Node.MUTABLE_LITERALS - removed:
const Node.OPERATOR_KEYWORDS - removed:
const Node.REFERENCES - removed:
const Node.SPECIAL_KEYWORDS - removed:
const Node.TRUTHY_LITERALS - removed:
const Node.VARIABLES - removed:
constructor Node(_, _ = …, _ = …) - removed:
method Node.ancestors() - removed:
method Node.asgn_method_call?() - removed:
method Node.basic_literal?() - removed:
method Node.binary_operation?() - removed:
method Node.chained?() - removed:
method Node.child_nodes() - removed:
method Node.complete!() - removed:
method Node.complete?() - removed:
method Node.const_name() - removed:
method Node.defined_module() - removed:
method Node.defined_module_name() - removed:
method Node.descendants() - removed:
method Node.each_ancestor(*) - removed:
method Node.each_child_node(*) - removed:
method Node.each_descendant(*) - removed:
method Node.each_node(*) - removed:
method Node.falsey_literal?() - removed:
method Node.immutable_literal?() - removed:
method Node.keyword?() - removed:
method Node.keyword_bang?() - removed:
method Node.keyword_not?() - removed:
method Node.literal?() - removed:
method Node.modifier_form?() - removed:
method Node.multiline?() - removed:
method Node.mutable_literal?() - removed:
method Node.parent_module_name() - removed:
method Node.pure?() - removed:
method Node.reference?() - removed:
method Node.sibling_index() - removed:
method Node.single_line?() - removed:
method Node.source() - removed:
method Node.source_range() - removed:
method Node.special_keyword?() - removed:
method Node.truthy_literal?() - removed:
method Node.unary_operation?() - removed:
method Node.updated(_ = …, _ = …, _ = …) - removed:
method Node.value_used?() - removed:
method Node.variable?() - removed:
method Sexp.s(_, *) - removed:
module Sexp - removed:
protected method Node.parent() - removed:
protected method Node.visit_descendants() - removed:
protected method Node.visit_descendants_with_types(_) - removed:
protected set Node.parent(_) - removed:
static method Node.def_matcher(_, _) - added:
class MagicComment - added:
const Config.OBSOLETE_PARAMETERS - added:
const MagicComment.TOKEN - added:
constructor MagicComment(_) - added:
method MagicComment.frozen_string_literal() - added:
method MagicComment.frozen_string_literal?() - added:
method MagicComment.frozen_string_literal_specified?() - added:
module AST - added:
static method MagicComment.parse(_)
- added:
class ArrayNode < Node - added:
class Builder < Parser::Builders::Default - added:
class CaseNode < Node - added:
class ForNode < Node - added:
class HashNode < Node - added:
class IfNode < Node - added:
class KeywordSplatNode < Node - added:
class Node < Parser::AST::Node - added:
class PairNode < Node - added:
class UntilNode < Node - added:
class WhenNode < Node - added:
class WhileNode < Node - added:
const ArrayNode.PERCENT_LITERAL_TYPES - added:
const Builder.NODE_MAP - added:
const KeywordSplatNode.DOUBLE_SPLAT - added:
const Node.BASIC_LITERALS - added:
const Node.COMPARISON_OPERATORS - added:
const Node.COMPOSITE_LITERALS - added:
const Node.FALSEY_LITERALS - added:
const Node.IMMUTABLE_LITERALS - added:
const Node.KEYWORDS - added:
const Node.LITERALS - added:
const Node.MUTABLE_LITERALS - added:
const Node.OPERATOR_KEYWORDS - added:
const Node.REFERENCES - added:
const Node.SPECIAL_KEYWORDS - added:
const Node.TRUTHY_LITERALS - added:
const Node.VARIABLES - added:
const PairNode.COLON - added:
const PairNode.HASH_ROCKET - added:
const PairNode.SPACED_COLON - added:
const PairNode.SPACED_HASH_ROCKET - added:
const Traversal.MANY_CHILD_NODES - added:
const Traversal.NO_CHILD_NODES - added:
const Traversal.ONE_CHILD_NODE - added:
const Traversal.SECOND_CHILD_ONLY - added:
constructor Node(_, _ = …, _ = …) - added:
method ArrayNode.percent_literal?(_ = …) - added:
method ArrayNode.square_brackets?() - added:
method ArrayNode.values() - added:
method Builder.n(_, _, _) - added:
method Builder.string_value(_) - added:
method CaseNode.each_when() - added:
method CaseNode.else?() - added:
method CaseNode.else_branch() - added:
method CaseNode.keyword() - added:
method CaseNode.node_parts() - added:
method CaseNode.when_branches() - added:
method ConditionalNode.body() - added:
method ConditionalNode.condition() - added:
method ConditionalNode.multiline_condition?() - added:
method ConditionalNode.single_line_condition?() - added:
method ForNode.body() - added:
method ForNode.collection() - added:
method ForNode.do?() - added:
method ForNode.keyword() - added:
method ForNode.node_parts() - added:
method ForNode.variable() - added:
method HashElementNode.delimiter_delta(_) - added:
method HashElementNode.key() - added:
method HashElementNode.key_delta(_, _ = …) - added:
method HashElementNode.same_line?(_) - added:
method HashElementNode.value() - added:
method HashElementNode.value_delta(_) - added:
method HashNode.braces?() - added:
method HashNode.each_key() - added:
method HashNode.each_pair() - added:
method HashNode.each_value() - added:
method HashNode.keys() - added:
method HashNode.mixed_delimiters?() - added:
method HashNode.pairs() - added:
method HashNode.pairs_on_same_line?() - added:
method HashNode.values() - added:
method IfNode.else?() - added:
method IfNode.else_branch() - added:
method IfNode.elsif?() - added:
method IfNode.if?() - added:
method IfNode.if_branch() - added:
method IfNode.inverse_keyword() - added:
method IfNode.keyword() - added:
method IfNode.modifier_form?() - added:
method IfNode.nested_conditional?() - added:
method IfNode.node_parts() - added:
method IfNode.ternary?() - added:
method IfNode.unless?() - added:
method KeywordSplatNode.colon?() - added:
method KeywordSplatNode.hash_rocket?() - added:
method KeywordSplatNode.node_parts() - added:
method KeywordSplatNode.operator() - added:
method ModifierNode.modifier_form?() - added:
method Node.ancestors() - added:
method Node.argument?() - added:
method Node.asgn_method_call?() - added:
method Node.basic_literal?() - added:
method Node.binary_operation?() - added:
method Node.chained?() - added:
method Node.child_nodes() - added:
method Node.complete!() - added:
method Node.complete?() - added:
method Node.const_name() - added:
method Node.defined_module() - added:
method Node.defined_module_name() - added:
method Node.descendants() - added:
method Node.each_ancestor(*) - added:
method Node.each_child_node(*) - added:
method Node.each_descendant(*) - added:
method Node.each_node(*) - added:
method Node.falsey_literal?() - added:
method Node.immutable_literal?() - added:
method Node.keyword?() - added:
method Node.keyword_bang?() - added:
method Node.keyword_not?() - added:
method Node.literal?() - added:
method Node.multiline?() - added:
method Node.mutable_literal?() - added:
method Node.numeric_type?() - added:
method Node.parent_module_name() - added:
method Node.pure?() - added:
method Node.reference?() - added:
method Node.sibling_index() - added:
method Node.single_line?() - added:
method Node.source() - added:
method Node.source_range() - added:
method Node.special_keyword?() - added:
method Node.truthy_literal?() - added:
method Node.unary_operation?() - added:
method Node.updated(_ = …, _ = …, _ = …) - added:
method Node.value_used?() - added:
method Node.variable?() - added:
method PairNode.colon?() - added:
method PairNode.delimiter(_ = …) - added:
method PairNode.hash_rocket?() - added:
method PairNode.inverse_delimiter(_ = …) - added:
method PairNode.node_parts() - added:
method Sexp.s(_, *) - added:
method Traversal.on_block(_) - added:
method Traversal.on_case(_) - added:
method Traversal.on_casgn(_) - added:
method Traversal.on_class(_) - added:
method Traversal.on_const(_) - added:
method Traversal.on_csend(_) - added:
method Traversal.on_def(_) - added:
method Traversal.on_defs(_) - added:
method Traversal.on_ensure(_) - added:
method Traversal.on_for(_) - added:
method Traversal.on_if(_) - added:
method Traversal.on_module(_) - added:
method Traversal.on_op_asgn(_) - added:
method Traversal.on_resbody(_) - added:
method Traversal.on_rescue(_) - added:
method Traversal.on_sclass(_) - added:
method Traversal.on_send(_) - added:
method Traversal.on_until(_) - added:
method Traversal.on_when(_) - added:
method Traversal.on_while(_) - added:
method Traversal.walk(_) - added:
method UntilNode.do?() - added:
method UntilNode.inverse_keyword() - added:
method UntilNode.keyword() - added:
method UntilNode.node_parts() - added:
method WhenNode.body() - added:
method WhenNode.branch_index() - added:
method WhenNode.conditions() - added:
method WhenNode.each_condition() - added:
method WhenNode.node_parts() - added:
method WhenNode.then?() - added:
method WhileNode.do?() - added:
method WhileNode.inverse_keyword() - added:
method WhileNode.keyword() - added:
method WhileNode.node_parts() - added:
module ConditionalNode - added:
module HashElementNode - added:
module ModifierNode - added:
module Sexp - added:
module Traversal - added:
protected method Node.parent() - added:
protected method Node.visit_descendants(_) - added:
protected set Node.parent(_) - added:
static method Node.def_matcher(_, _)
- removed:
class CopStore < ::Array - removed:
const ConfigurableNaming.CAMEL_CASE - removed:
const ConfigurableNaming.SNAKE_CASE - removed:
const ConfigurableNumbering.NON_INTEGER - removed:
const ConfigurableNumbering.NORMAL_CASE - removed:
const ConfigurableNumbering.SNAKE_CASE - removed:
method ArraySyntax.square_brackets?(_) - removed:
method ConfigurableEnforcedStyle.parameter_name() - removed:
method ConfigurableMax.parameter_name() - removed:
method ConfigurableNaming.check_name(_, _, _) - removed:
method ConfigurableNaming.class_emitter_method?(_, _) - removed:
method ConfigurableNaming.valid_name?(_, _) - removed:
method ConfigurableNumbering.check_name(_, _, _) - removed:
method ConfigurableNumbering.class_emitter_method?(_, _) - removed:
method ConfigurableNumbering.valid_name?(_, _, _) - removed:
method Cop.debug?() - removed:
method Cop.details() - removed:
method Cop.display_cop_names?() - removed:
method Cop.display_style_guide?() - removed:
method Cop.extra_details?() - removed:
method Cop.reference_url() - removed:
method Cop.style_guide_url() - removed:
method CopStore.cop_name_with_namespace(_, _, _, _) - removed:
method CopStore.qualified_cop_name(_, _) - removed:
method CopStore.types() - removed:
method CopStore.with_type(_) - removed:
method CopStore.without_type(_) - removed:
method HashNode.any_pairs_on_the_same_line?(_) - removed:
method IfNode.elsif?(_) - removed:
method IfNode.if_else?(_) - removed:
method IfNode.if_node_parts(_) - removed:
method IfNode.modifier_if?(_) - removed:
method IfNode.ternary?(_) - removed:
method OnNormalIfUnless.case_else_clause(_) - removed:
method OnNormalIfUnless.if_else_clause(_) - removed:
method OnNormalIfUnless.invoke_hook_for_normal_if_unless(_) - removed:
method TrailingComma.parameter_name() - removed:
module HashNode - removed:
module IfNode - removed:
static method Cop.cop_type() - changed:
static method FrozenStringLiteral.frozen_string_literal_comment_exists?(_, _ = …) → static method FrozenStringLiteral.frozen_string_literal_comment_exists?() - changed:
static method FrozenStringLiteral.frozen_string_literals_enabled?(_) → static method FrozenStringLiteral.frozen_string_literals_enabled?() - added:
class Badge - added:
class MessageAnnotator - added:
class Registry - added:
const AmbiguousCopName.MSG - added:
const ConfigurableNaming.FORMATS - added:
const ConfigurableNumbering.FORMATS - added:
const Util.CONDITIONAL_NODES - added:
const Util.LOGICAL_OPERATOR_NODES - added:
const Util.MODIFIER_NODES - added:
constructor AmbiguousCopName(_, _, _) - added:
constructor Badge(_, _) - added:
constructor MessageAnnotator(_, _, _) - added:
constructor Registry(_ = …) - added:
method Badge.==(_) - added:
method Badge.hash() - added:
method Badge.match?(_) - added:
method Badge.qualified?() - added:
method Badge.to_s() - added:
method Badge.with_department(_) - added:
method ConfigurableEnforcedStyle.alternative_styles() - added:
method ConfigurableEnforcedStyle.style_parameter_name() - added:
method ConfigurableFormatting.check_name(_, _, _) - added:
method ConfigurableFormatting.class_emitter_method?(_, _) - added:
method ConfigurableFormatting.report_opposing_styles(_, _) - added:
method ConfigurableFormatting.valid_name?(_, _, _ = …) - added:
method ConfigurableMax.max_parameter_name() - added:
method MessageAnnotator.annotate(_, _) - added:
method NegativeConditional.negated_condition(_) - added:
method NegativeConditional.negative_conditional_corrector(_) - added:
method OnMethodDef.method_def_node_parts(_) - added:
method Registry.==(_) - added:
method Registry.contains_cop_matching?(_) - added:
method Registry.cops() - added:
method Registry.departments() - added:
method Registry.each() - added:
method Registry.enabled(_, _) - added:
method Registry.enlist(_) - added:
method Registry.length() - added:
method Registry.names() - added:
method Registry.qualified_cop_name(_, _) - added:
method Registry.select() - added:
method Registry.sort!() - added:
method Registry.to_h() - added:
method Registry.with_department(_) - added:
method Registry.without_department(_) - added:
method TargetRubyVersion.minimum_target_ruby_version(_) - added:
method TargetRubyVersion.support_target_ruby_version?(_) - added:
method TrailingComma.style_parameter_name() - added:
module ConfigurableFormatting - added:
module Duplication - added:
module HashAlignment - added:
module TargetRubyVersion - added:
property Badge.cop_name: reader - added:
property Badge.department: reader - added:
property MessageAnnotator.config: reader - added:
property MessageAnnotator.cop_config: reader - added:
property MessageAnnotator.options: reader - added:
static method Badge.for(_) - added:
static method Badge.parse(_) - added:
static method Cop.badge() - added:
static method Cop.department() - added:
static method Util.to_supported_styles(_) - added:
static property Cop.registry: reader
- added:
class InvalidBadge < Error - added:
const InvalidBadge.MSG - added:
constructor InvalidBadge(_)
- added:
method OrderedGems.autocorrect(_) - added:
method OrderedGems.case_insensitive_out_of_order?(_, _) - added:
method OrderedGems.declaration_with_comment(_) - added:
method OrderedGems.previous_declaration(_) - added:
method OrderedGems.swap_range(_, _, _)
- added:
class CopError < Struct.new(:error, :line, :column)
- added:
class KeyAlignment - added:
class SeparatorAlignment - added:
class TableAlignment - added:
method KeyAlignment.checkable_layout?(_) - added:
method KeyAlignment.deltas(_, _) - added:
method KeyAlignment.deltas_for_first_pair(*) - added:
method SeparatorAlignment.deltas_for_first_pair(*) - added:
method TableAlignment.deltas_for_first_pair(_, _) - added:
method ValueAlignment.checkable_layout?(_) - added:
method ValueAlignment.deltas(_, _) - added:
module ValueAlignment
- removed:
class Eval < Cop - removed:
const Eval.MSG - removed:
method BlockAlignment.parameter_name() - removed:
method Eval.on_send(_) - added:
class MultipleCompare < Cop - added:
class SafeNavigationChain < Cop - added:
const ConditionPosition.MSG - added:
const ElseLayout.MSG - added:
const MultipleCompare.MSG - added:
const PercentStringArray.LEADING_QUOTE - added:
const PercentStringArray.QUOTES_AND_COMMAS - added:
const PercentStringArray.TRAILING_QUOTE - added:
const SafeNavigationChain.ADDITIONAL_NIL_METHODS - added:
const SafeNavigationChain.MSG - added:
const Void.DEFINED_MSG - added:
const Void.SELF_MSG - added:
method BlockAlignment.style_parameter_name() - added:
method MultipleCompare.autocorrect(_) - added:
method MultipleCompare.on_send(_) - added:
method SafeNavigationChain.autocorrect(_) - added:
method SafeNavigationChain.on_send(_)
- removed:
method CaseWhenSplat.autocorrect(_) - added:
class RegexpMatch < Cop - added:
const RegexpMatch.MATCH_NODE_PATTERN - added:
const RegexpMatch.MSG - added:
method RegexpMatch.autocorrect(_) - added:
method RegexpMatch.on_case(_) - added:
method RegexpMatch.on_if(_)
- removed:
method DelegateAllowBlank.autocorrect(_) - added:
class FilePath < Cop - added:
class ReversibleMigration < Cop - added:
class SkipsModelValidations < Cop - added:
const FilePath.MSG - added:
const ReversibleMigration.MSG - added:
const SkipsModelValidations.MSG - added:
method FilePath.on_dstr(_) - added:
method FilePath.on_send(_) - added:
method HttpPositionalArguments.format_arg?(_) - added:
method HttpPositionalArguments.special_keyword_arg?(_) - added:
method ReversibleMigration.on_send(_) - added:
method SkipsModelValidations.on_send(_)
- added:
class Eval < Cop - added:
class MarshalLoad < Cop - added:
class YAMLLoad < Cop - added:
const Eval.MSG - added:
const MarshalLoad.MSG - added:
const YAMLLoad.MSG - added:
method Eval.on_send(_) - added:
method MarshalLoad.on_send(_) - added:
method YAMLLoad.autocorrect(_) - added:
method YAMLLoad.on_send(_)
- removed:
class MethodCallParentheses < Cop - removed:
const ConditionalAssignment.IF - removed:
const ConditionalAssignment.UNLESS - removed:
const IfUnlessModifierOfIfUnless.MESSAGE - removed:
const MethodCallParentheses.ASGN_NODES - removed:
const MethodCallParentheses.MSG - removed:
constructor HashSyntax(*) - removed:
method ConditionalAssignment.autocorrect(_) - removed:
method ConditionalAssignment.check_assignment_to_condition(_) - removed:
method EmptyMethod.on_def(_) - removed:
method IfUnlessModifierOfIfUnless.message(_) - removed:
method IndentationWidth.check_members(_, _) - removed:
method InfiniteLoop.autocorrect(_) - removed:
method MethodCallParentheses.autocorrect(_) - removed:
method MethodCallParentheses.on_send(_) - removed:
method MultilineIfThen.autocorrect(_) - removed:
method MultilineIfThen.message(_) - removed:
method NestedModifier.autocorrect_if_unless(_, _) - removed:
method NestedModifier.modifier_while_or_until?(_) - removed:
method OneLineConditional.ternary(_) - removed:
method WhileUntilModifier.autocorrect(_) - changed:
method RedundantParentheses.disallowed_literal?(_) → method RedundantParentheses.disallowed_literal?(_, _) - added:
class MethodCallWithArgsParentheses < Cop - added:
class MethodCallWithoutArgsParentheses < Cop - added:
const CaseIndentation.MSG - added:
const FormatString.MSG - added:
const FrozenStringLiteralComment.MSG_UNNECESSARY - added:
const IfUnlessModifier.MSG - added:
const IfUnlessModifierOfIfUnless.MSG - added:
const InfiniteLoop.LEADING_SPACE - added:
const MethodCallWithArgsParentheses.MSG - added:
const MethodCallWithoutArgsParentheses.ASGN_NODES - added:
const MethodCallWithoutArgsParentheses.MSG - added:
const MultilineIfThen.MSG - added:
const MultilineIfThen.NON_MODIFIER_THEN - added:
const PercentQLiterals.LOWER_CASE_Q_MSG - added:
const PercentQLiterals.UPPER_CASE_Q_MSG - added:
const WhileUntilDo.MSG - added:
const WhileUntilModifier.MSG - added:
method EmptyMethod.on_method_def(_, _, _, _) - added:
method FormatString.message(_) - added:
method FormatString.method_name(_) - added:
method MethodCallWithArgsParentheses.autocorrect(_) - added:
method MethodCallWithArgsParentheses.on_send(_) - added:
method MethodCallWithArgsParentheses.on_super(_) - added:
method MethodCallWithArgsParentheses.on_yield(_) - added:
method MethodCallWithoutArgsParentheses.autocorrect(_) - added:
method MethodCallWithoutArgsParentheses.on_send(_) - added:
method OneLineConditional.to_ternary(_) - added:
method RedundantParentheses.allowed_multiple_expression?(_) - added:
method RedundantParentheses.raised_to_power_negative_numeric?(_, _) - added:
method SafeNavigation.allowed_if_condition?(_)
- removed:
class AlignmentOfValues - removed:
class KeyAlignment - removed:
class SeparatorAlignment < AlignmentOfValues - removed:
class TableAlignment < AlignmentOfValues - removed:
method AlignmentOfValues.checkable_layout(_) - removed:
method AlignmentOfValues.deltas(_, _) - removed:
method KeyAlignment.checkable_layout(_) - removed:
method KeyAlignment.deltas(_, _) - removed:
method KeyAlignment.deltas_for_first_pair(*) - removed:
method SeparatorAlignment.deltas_for_first_pair(*) - removed:
method TableAlignment.deltas_for_first_pair(_, _)
- added:
class EditorComment < MagicComment - added:
class EmacsComment < EditorComment - added:
class SimpleComment < MagicComment - added:
class VimComment < EditorComment - added:
const EmacsComment.FORMAT - added:
const EmacsComment.OPERATOR - added:
const EmacsComment.SEPARATOR - added:
const VimComment.FORMAT - added:
const VimComment.OPERATOR - added:
const VimComment.SEPARATOR - added:
method EmacsComment.encoding() - added:
method SimpleComment.encoding() - added:
method VimComment.encoding() - added:
method VimComment.frozen_string_literal()
- removed:
class Builder < Parser::Builders::Default - removed:
const Traversal.MANY_CHILD_NODES - removed:
const Traversal.NO_CHILD_NODES - removed:
const Traversal.ONE_CHILD_NODE - removed:
const Traversal.SECOND_CHILD_ONLY - removed:
method Builder.n(_, _, _) - removed:
method Builder.string_value(_) - removed:
method Traversal.on_block(_) - removed:
method Traversal.on_case(_) - removed:
method Traversal.on_casgn(_) - removed:
method Traversal.on_class(_) - removed:
method Traversal.on_const(_) - removed:
method Traversal.on_csend(_) - removed:
method Traversal.on_def(_) - removed:
method Traversal.on_defs(_) - removed:
method Traversal.on_ensure(_) - removed:
method Traversal.on_for(_) - removed:
method Traversal.on_if(_) - removed:
method Traversal.on_module(_) - removed:
method Traversal.on_op_asgn(_) - removed:
method Traversal.on_resbody(_) - removed:
method Traversal.on_rescue(_) - removed:
method Traversal.on_sclass(_) - removed:
method Traversal.on_send(_) - removed:
method Traversal.on_until(_) - removed:
method Traversal.on_when(_) - removed:
method Traversal.on_while(_) - removed:
method Traversal.walk(_) - removed:
module Traversal