Skip to content
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

Add job for CI using Prism parser #1980

Merged
merged 1 commit into from
Oct 29, 2024
Merged

Add job for CI using Prism parser #1980

merged 1 commit into from
Oct 29, 2024

Conversation

bquorning
Copy link
Collaborator

@bquorning bquorning commented Oct 17, 2024

Inspired by rubocop/rubocop-capybara#112


Before submitting the PR make sure the following are checked:

  • Feature branch is up-to-date with master (if not - rebase it).
  • Squashed related commits together.
  • Added tests.
  • Updated documentation.
  • Added an entry to the CHANGELOG.md if the new code introduces user-observable changes.
  • The build (bundle exec rake) passes (be sure to run this locally, since it may produce updated documentation that you will need to commit).

@pirj
Copy link
Member

pirj commented Oct 17, 2024

But ruby-head is prism already, isn’t this sufficient?

@bquorning
Copy link
Collaborator Author

Ah yes, probably so. I'll keep this in draft and look at it again next week.

@Earlopain
Copy link
Contributor

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.

@pirj
Copy link
Member

pirj commented Oct 25, 2024

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? 🤔

@bquorning bquorning marked this pull request as ready for review October 25, 2024 10:06
@bquorning bquorning requested a review from a team as a code owner October 25, 2024 10:06
@Earlopain
Copy link
Contributor

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. rubocop/rubocop-rails#1245. The other changes are for places that construct ProcessedSource themselves but I don't believe that will be the case here.

bundler-cache: true
- env:
PARSER_ENGINE: parser_prism
run: NO_COVERAGE=true bundle exec rake
Copy link
Contributor

@Earlopain Earlopain Oct 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Docs generator is broken with Ruby 2.7, I openend rubocop/rubocop#13388. Probably, you can just run bundle exec rake spec here regardless. I don't think the other tasks really need to run with prism.

@bquorning
Copy link
Collaborator Author

I changed it to run only rake spec and not all of rake. Does it look ok now?

Copy link
Member

@ydah ydah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Thank you♥

@ydah ydah merged commit f2b7cd1 into master Oct 29, 2024
25 checks passed
@ydah ydah deleted the bquorning/prism branch October 29, 2024 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants