Closed bquorning closed 3 weeks ago
But ruby-head is prism already, isn’t this sufficient?
Ah yes, probably so. I'll keep this in draft and look at it again next week.
My understanding is that it will still use the plain parser gem, even with ruby-head/ruby-3.4 The prism default is runtime-only. Users need to set it in their config files still, even when targeting ruby 3.3 or higher.
Thanks for the hint, @Earlopain !
I’m good with a separate ci job with prism. Do we need to turn it on in RuboCop somehow? 🤔
As a user, you would set AllCops/ParserEngine
. For extensions, this should have you covered: https://github.com/rubocop/rubocop/blob/9f2ffa2270bbc174b2a622350d120b05672a1ce5/lib/rubocop/rspec/cop_helper.rb#L13. I'm not immediatly finding the place where you inherit this, but you probably do somewhere? Since you use the same assertion methods from RuboCop::RSpec::ExpectOffense
.
For reference, here's the PR for rubocop-rails
and it basically only sets the env variable. https://github.com/rubocop/rubocop-rails/pull/1245. The other changes are for places that construct ProcessedSource
themselves but I don't believe that will be the case here.
I changed it to run only rake spec
and not all of rake
. Does it look ok now?
Inspired by https://github.com/rubocop/rubocop-capybara/pull/112
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).