Skip to content

Commit

Permalink
Support Prism as a Ruby parser
Browse files Browse the repository at this point in the history
  • Loading branch information
ydah committed Mar 21, 2024
1 parent 866f2b2 commit 3ee2ad7
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 1 deletion.
16 changes: 16 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,19 @@ jobs:
ruby-version: "3.3"
bundler-cache: true
- run: NO_COVERAGE=true bundle exec rake ${{ matrix.task }}

prism:
runs-on: ubuntu-latest
name: Prism
steps:
- uses: actions/checkout@v4
- name: set up Ruby
uses: ruby/setup-ruby@v1
with:
# Specify the minimum Ruby version 2.7 required for Prism to run.
ruby-version: 2.7
bundler-cache: true
- name: spec
env:
PARSER_ENGINE: parser_prism
run: NO_COVERAGE=true bundle exec rake prism_spec
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## Master (Unreleased)

- Support Prism as a Ruby parser (experimental). ([@ydah])

## 2.25.1 (2024-01-08)

- Fix a false positive for `FactoryBot/CreateList` when create call does have method calls and repeat multiple times with other argument. ([@ydah])
Expand Down
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ gemspec

gem 'bump'
gem 'danger'
gem 'prism'
gem 'rack'
gem 'rake'
gem 'rspec', '~> 3.11'
Expand Down
9 changes: 8 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,14 @@ task confirm_documentation: :generate_cops_documentation do
end
end

task default: %i[build_config spec
desc 'Run RSpec with Prism'
task :prism_spec do
sh('PARSER_ENGINE=parser_prism bundle exec rake spec')
end

task default: %i[build_config
spec
prism_spec
internal_investigation
confirm_config
documentation_syntax_check
Expand Down
1 change: 1 addition & 0 deletions rubocop-factory_bot.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,5 @@ Gem::Specification.new do |spec|
}

spec.add_runtime_dependency 'rubocop', '~> 1.41'
spec.add_runtime_dependency 'rubocop-ast', '>= 1.31.1', '< 2.0'
end

0 comments on commit 3ee2ad7

Please sign in to comment.