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

Support Prism as a Ruby parser #304

Merged
merged 1 commit into from
Mar 4, 2024
Merged

Support Prism as a Ruby parser #304

merged 1 commit into from
Mar 4, 2024

Conversation

koic
Copy link
Member

@koic koic commented Mar 2, 2024

Follow up rubocop/rubocop-ast#277

There are no changes to the implementation, but the required dependency version of RuboCop AST will be updated. It would be more rational than adding new dependency on gem 'rubocop-ast', '>= 1.31.1' in the Gemfile just to bump up the minor version.

RuboCop Minitest now ensures that RuboCop::AST::ProcessedSource used in tests is aware of parser_engine parameter.

Tests for RuboCop AST with Prism as the backend can be run as follows:

bundle exec rake prism_test

The above is the shortcut alias for:

PARSER_ENGINE=parser_prism bundle exec rake test

RuboCop works on Ruby versions 2.7+, but since Prism only targets parsing for Ruby 3.3+, internal_investigation Rake task will not be executed. This task is only run with the Parser gem, which can parse Ruby versions 2.0+.


Before submitting the PR make sure the following are checked:

  • The PR relates to only one subject with a clear title and description in grammatically correct, complete sentences.
  • Wrote good commit messages.
  • Commit message starts with [Fix #issue-number] (if the related issue exists).
  • Feature branch is up-to-date with master (if not - rebase it).
  • Squashed related commits together.
  • Added tests.
  • Ran bundle exec rake default. It executes all tests and runs RuboCop on its own code.
  • Added an entry (file) to the changelog folder named {change_type}_{change_description}.md if the new code introduces user-observable changes. See changelog entry format for details.

@koic koic force-pushed the support_prism branch 2 times, most recently from 2a74761 to 0d3ddbc Compare March 4, 2024 01:36
Follow up rubocop/rubocop-ast#277

There are no changes to the implementation, but the required dependency version of
RuboCop AST will be updated. It would be more rational than adding new dependency on
`gem 'rubocop-ast', '>= 1.31.1'` in the Gemfile just to bump up the minor version.

RuboCop Minitest now ensures that `RuboCop::AST::ProcessedSource` used in tests is aware of
`parser_engine` parameter.

Tests for RuboCop AST with Prism as the backend can be run as follows:

```console
bundle exec rake prism_test
```

The above is the shortcut alias for:

```console
PARSER_ENGINE=parser_prism bundle exec rake test
```

RuboCop works on Ruby versions 2.7+, but since Prism only targets parsing for Ruby 3.3+,
`internal_investigation` Rake task will not be executed. This task is only run with the Parser gem,
which can parse Ruby versions 2.0+.
@koic koic merged commit b73940d into rubocop:master Mar 4, 2024
14 checks passed
@koic koic deleted the support_prism branch March 4, 2024 16:01
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.

1 participant