Skip to content

Prepare RuboCop upgrade

Peter Leitzen requested to merge pl-rubocop-prepare-upgrade into master

What does this MR do and why?

This MR prepares upgrade to RuboCop 1.36.0 in !96880 (merged).

It extracted two commits from that MR (!96880 (6bff737b) and !96880 (8e7413ae)) and reverted changes which performed the actual upgrade.

  1. Inherit from RuboCop::Cop::Base, not RuboCop::Cop::Cop.
  2. New auto-correction style - extend RuboCop::Cop::AutoCorrector, pass a block to add_offense rather than defining an autocorrect method.
  3. add_offense no longer takes a location keyword argument.
  4. Specs should not set subject(:cop) as that will be done automatically, and will use the config correctly.

The spec pass with RuboCop 0.93.1

How to set up and validate locally

bin/rspec spec/rubocop

bundle exec rubocop --parallel

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Peter Leitzen

Merge request reports