Upgrading rubocop 0.86 to 0.87
Breaking0.86.0 → 0.87.1Breaking3New10Changed1Fixed14Other1
BreakingUpgrade verdict
3 breaking changes.
In plain terms
- (Breaking) rubocop -a / --autocorrect no longer run unsafe corrections; rubocop -A / --autocorrect-all run both safe and unsafe corrections.
- (Breaking) Order for gems names now disregards underscores and dashes unless ConsiderPunctuation setting is set to true.
- (Breaking) Extensive refactoring of internal classes Team, Commissioner, Corrector.
Must act 3 items need code or config changes
What you must change
Breaking3
(Breaking) rubocop -a / --autocorrect no longer run unsafe corrections; rubocop -A / --autocorrect-all run both safe and unsafe corrections.
--safe-autocorrect(Breaking) Order for gems names now disregards underscores and dashes unless ConsiderPunctuation setting is set to true.
ConsiderPunctuationtrue(Breaking) Extensive refactoring of internal classes Team, Commissioner, Corrector.
TeamCommissionerCorrectorCop::Cop#correctionsAPI changes
Generated by DepDelta from published Ruby source. Not mixed with prose notes.
- removed:
const ConfigLoader.AUTO_GENERATED_FILE - removed:
static method ConfigLoader.add_inheritance_from_auto_generated_file() - removed:
static property ConfigLoader.auto_gen_config: accessor - removed:
static property ConfigLoader.auto_gen_config?: accessor - removed:
static property ConfigLoader.options_config: accessor - changed:
class RakeTask < Rake::TaskLib → class RakeTask < ::Rake::TaskLib - added:
static method ConfigLoader.load_yaml_configuration(_)
- added:
const AutoGenerateConfig.AUTO_GENERATED_FILE
- removed:
const Team.DEFAULT_OPTIONS - removed:
constructor Cop(_ = …, _ = …) - removed:
method AutocorrectLogic.disable_offense(_) - removed:
method AutocorrectLogic.support_autocorrect?() - removed:
method Cop.config_to_allow_offenses() - removed:
method Cop.cop_config() - removed:
method Cop.cop_name() - removed:
method Cop.correct(_) - removed:
method Cop.disable_uncorrectable(_) - removed:
method Cop.duplicate_location?(_) - removed:
method Cop.excluded_file?(_) - removed:
method Cop.external_dependency_checksum() - removed:
method Cop.join_force?(_) - removed:
method Cop.message(_ = …) - removed:
method Cop.name() - removed:
method Cop.reason_to_not_correct(_) - removed:
method Cop.relevant_file?(_) - removed:
method Cop.target_rails_version() - removed:
method Cop.target_ruby_version() - removed:
method Corrector.insert_after(_, _) - removed:
method Corrector.insert_before(_, _) - removed:
method Corrector.remove(_) - removed:
method Corrector.replace(_, _) - removed:
method Corrector.wrap(_, _, _) - removed:
method Team.autocorrect(_, _) - removed:
module ClassishLength - removed:
property Cop.config: reader - removed:
property Cop.corrections: reader - removed:
property Cop.processed_source: accessor - removed:
property Corrector.corrections: reader - removed:
property Corrector.diagnostics: reader - removed:
set Cop.config_to_allow_offenses(_) - removed:
static method Cop.autocorrect_incompatible_with() - removed:
static method Cop.badge() - removed:
static method Cop.cop_name() - removed:
static method Cop.department() - removed:
static method Cop.exclude_from_registry() - removed:
static method Cop.lint?() - removed:
static method Cop.match?(_) - changed:
class Cop → class Cop < Base - changed:
class Corrector → class Corrector < ::Parser::Source::TreeRewriter - changed:
constructor Corrector(_, _ = …) → constructor Corrector(_) - changed:
constructor Offense(_, _, _, _, _ = …) → constructor Offense(_, _, _, _, _ = …, _ = …) - changed:
method Team.forces_for(_) → static method Team.forces_for(_) - added:
class Base - added:
const VisibilityHelp.VISIBILITY_SCOPES - added:
constructor Base(_ = …, _ = …) - added:
method AutoCorrector.support_autocorrect?() - added:
method Base.add_global_offense(_ = …, severity: …) - added:
method Base.add_offense(_, message: …, severity: …) - added:
method Base.config_to_allow_offenses() - added:
method Base.cop_config() - added:
method Base.cop_name() - added:
method Base.excluded_file?(_) - added:
method Base.external_dependency_checksum() - added:
method Base.message(_ = …) - added:
method Base.name() - added:
method Base.offenses() - added:
method Base.on_investigation_end() - added:
method Base.on_new_investigation() - added:
method Base.on_other_file() - added:
method Base.ready() - added:
method Base.relevant_file?(_) - added:
method Base.target_rails_version() - added:
method Base.target_ruby_version() - added:
method Cop.corrections() - added:
method Cop.on_investigation_end() - added:
method Cop.on_new_investigation() - added:
method Cop.support_autocorrect?() - added:
method Team.investigate(_) - added:
module AllowedMethods - added:
module AutoCorrector - added:
module Legacy - added:
module VisibilityHelp - added:
property Base.config: reader - added:
property Base.processed_source: reader - added:
property Offense.corrector: reader - added:
set Base.config_to_allow_offenses(_) - added:
static method Base.autocorrect_incompatible_with() - added:
static method Base.badge() - added:
static method Base.cop_name() - added:
static method Base.department() - added:
static method Base.exclude_from_registry() - added:
static method Base.joining_forces() - added:
static method Base.lint?() - added:
static method Base.match?(_) - added:
static method Base.support_autocorrect?() - added:
static method Base.support_multiple_source?() - added:
static method Cop.joining_forces() - added:
static method Cop.support_autocorrect?() - added:
static method Corrector.source_buffer(_)
- added:
class InvestigationReport < Struct.new(:cop, :processed_source, :offenses, :corrector)
- removed:
method InsecureProtocolSource.autocorrect(_) - changed:
class InsecureProtocolSource < Cop → class InsecureProtocolSource < Base
- added:
class InvestigationReport < Struct.new(:processed_source, :cop_reports, :errors) - added:
method InvestigationReport.cops() - added:
method InvestigationReport.correctors() - added:
method InvestigationReport.merge(_) - added:
method InvestigationReport.offenses() - added:
method InvestigationReport.offenses_per_cop()
- removed:
method NodeTypePredicate.autocorrect(_) - changed:
class NodeTypePredicate < Cop → class NodeTypePredicate < Base
- removed:
const ClassStructure.VISIBILITY_SCOPES - removed:
method CaseIndentation.autocorrect(_) - removed:
method SpaceAroundBlockParameters.autocorrect(_) - changed:
class CaseIndentation < Cop → class CaseIndentation < Base - changed:
class SpaceAroundBlockParameters < Cop → class SpaceAroundBlockParameters < Base
- added:
class CorrectionsProxy - added:
class Corrector < RuboCop::Cop::Corrector - added:
constructor CorrectionsProxy(_) - added:
constructor Corrector(_, _ = …) - added:
method CorrectionsProxy.<<(_) - added:
method CorrectionsProxy.concat(_) - added:
method CorrectionsProxy.empty?() - added:
method Corrector.corrections() - added:
protected property CorrectionsProxy.corrector: reader
- removed:
method RedundantCopDisableDirective.autocorrect(_) - removed:
method RedundantCopDisableDirective.check(_, _, _) - removed:
method Syntax.add_offense_from_diagnostic(_, _) - removed:
method Syntax.add_offense_from_error(_) - removed:
static method Syntax.offenses_from_processed_source(_, _, _) - changed:
class RedundantCopDisableDirective < Cop → class RedundantCopDisableDirective < Base - changed:
class Syntax < Cop → class Syntax < Base - added:
constructor RedundantCopDisableDirective(_ = …, _ = …, _ = …) - added:
method InterpolationCheck.autocorrect(_) - added:
method RedundantCopDisableDirective.on_new_investigation() - added:
method SafeNavigationWithEmpty.autocorrect(_) - added:
method Syntax.on_other_file() - added:
property RedundantCopDisableDirective.offenses_to_check: accessor
- removed:
class ERROR_SOURCE_RANGE < PseudoSourceRange.new(1, 0, '', 0, 1) - removed:
class PseudoSourceRange < Struct.new(:line, :column, :source_line, :begin_pos, :end_pos)
- added:
class CodeLengthCalculator - added:
const CodeLengthCalculator.CLASSISH_TYPES - added:
const CodeLengthCalculator.FOLDABLE_TYPES - added:
constructor CodeLengthCalculator(_, count_comments: …, foldable_types: …) - added:
method CodeLengthCalculator.calculate()
- removed:
const AsciiIdentifiers.MSG - removed:
const BinaryOperatorParameterName.BLACKLISTED - changed:
class MethodName < Cop → class MethodName < Base - changed:
class VariableName < Cop → class VariableName < Base - changed:
class VariableNumber < Cop → class VariableNumber < Base - added:
const AsciiIdentifiers.CONSTANT_MSG - added:
const AsciiIdentifiers.IDENTIFIER_MSG - added:
const BinaryOperatorParameterName.EXCLUDED
- added:
class NO_LOCATION < PseudoSourceRange.new(1, 0, '', 0, 1) - added:
class PseudoSourceRange < Struct.new(:line, :column, :source_line, :begin_pos, :end_pos)
- removed:
method RedundantException.autocorrect(_) - changed:
class RedundantException < Cop → class RedundantException < Base - added:
class AccessorGrouping < Cop - added:
class BisectedAttrAccessor < Cop - added:
class RedundantAssignment < Cop - added:
const AccessorGrouping.ACCESSOR_METHODS - added:
const AccessorGrouping.GROUPED_MSG - added:
const AccessorGrouping.SEPARATED_MSG - added:
const BisectedAttrAccessor.MSG - added:
const RedundantAssignment.MSG - added:
method AccessorGrouping.autocorrect(_) - added:
method AccessorGrouping.on_class(_) - added:
method AccessorGrouping.on_module(_) - added:
method AccessorGrouping.on_sclass(_) - added:
method BisectedAttrAccessor.autocorrect(_) - added:
method BisectedAttrAccessor.on_class(_) - added:
method BisectedAttrAccessor.on_module(_) - added:
method BisectedAttrAccessor.on_sclass(_) - added:
method ClassVars.on_send(_) - added:
method IfUnlessModifierOfIfUnless.autocorrect(_) - added:
method RedundantAssignment.autocorrect(_) - added:
method RedundantAssignment.on_def(_) - added:
method RedundantAssignment.on_defs(_) - added:
method RedundantException.fix_compact(_) - added:
method RedundantException.fix_exploded(_)
- removed:
class Investigation < Struct.new(:offenses, :errors)
- changed:
method ExpectOffense.expect_offense(_, _ = …, **) → method ExpectOffense.expect_offense(_, _ = …, severity: …, **)