-
-
Notifications
You must be signed in to change notification settings - Fork 278
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pluginfy RuboCop RSpec #2042
Pluginfy RuboCop RSpec #2042
Conversation
5a3a9e6
to
eba373f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Our users will not be able to continue using require
in their config file, right? They need to start using plugins
instead?
d4325ec
to
b96ee8d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CI is failing because module RuboCop::RSpec::Plugin#about
never gets called. Would it make sense to make an assertion on e.g.
env = Struct.new(:config_store).new(RuboCop::ConfigStore.new))
RuboCop::Version.extension_versions(env)
including the string "rubocop-rspec"
?
For compatibility, the old |
Sorry, |
Note, a simple plugin migration guide is available for reference: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
I’m away from my computer for a few days and can’t test manually.
This PR adds support for RuboCop's Plugin feature: rubocop/rubocop#13792 It replaces the ad-hoc `Inject` with RuboCop plugins introduced in RuboCop 1.72. NOTE: Version 1.72.1 or later is specified, as it includes rubocop/rubocop#13837, which removes the `Inject` from spec_helper.rb. While 1.72.0 is sufficient for runtime, but specifying the patch version 1.72.1 keeps things simple.
b96ee8d
to
5f09fdf
Compare
Thank you @koic 🙏🏼 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
This PR adds support for RuboCop's Plugin feature: rubocop/rubocop#13792
It replaces the ad-hoc
Inject
with RuboCop plugins introduced in RuboCop 1.72.NOTE: Version 1.72.1 or later is specified, as it includes rubocop/rubocop#13837, which removes the
Inject
from spec_helper.rb. While 1.72.0 is sufficient for runtime, but specifying the patch version 1.72.1 keeps things simple.Before submitting the PR make sure the following are checked:
master
(if not - rebase it).CHANGELOG.md
if the new code introduces user-observable changes.bundle exec rake
) passes (be sure to run this locally, since it may produce updated documentation that you will need to commit).If you have created a new cop:
config/default.yml
.Enabled: pending
inconfig/default.yml
.Enabled: true
in.rubocop.yml
.VersionAdded: "<<next>>"
indefault/config.yml
.If you have modified an existing cop's configuration options:
VersionChanged: "<<next>>"
inconfig/default.yml
.