You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The autocorrection API was changed in Rubocop v0.87.0 (pull request rubocop/rubocop#7868).
Here, I change the superclass of `RuboCop::Cop::RSpec::Cop` from
`::RuboCop::Cop::Cop` to `::RuboCop::Cop::Base`.
This has a few consequences:
- Our `#message` methods get called with a different argument than
before. It *can* be customized by defining a `#callback_argument`
method, but I think it is clearer to avoid callbacks altogether.
- Our `#autocorrect` methods don't get called anymore. Instead, we
extend `Autocorrector`, and the `corrector` is being yielded when
calling `#add_offense`, so the code is mostly moved in there. For some
cases, this means that some code can be removed, which is nice. For
some cases, it means that the methods get too long, or the code
complexity gets too high, and in those cases I chose to just call out
to an `#autocorrect` method anyway, but of course passing the
`corrector` and any usable local variables along.
This also means we bump the dependency of RuboCop quite a bit, from
'>= 0.68.1' to '>= 0.87.0'.
0 commit comments