Skip to content

Commit bc3f71f

Browse files
committed
RuboCop now uses prism as a first-class (translation) parser
Since rubocop 1.75 it just does the right thing, so no need to mention much of the old configuration anymore.
1 parent 71432af commit bc3f71f

1 file changed

Lines changed: 2 additions & 20 deletions

File tree

docs/parser_translation.md

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -25,24 +25,6 @@ If you also need to parse Ruby versions below 3.3 (which `prism` has no support
2525

2626
### RuboCop
2727

28-
Prism as a parser engine is directly supported since RuboCop 1.62.
28+
Prism as a parser engine is directly supported since RuboCop 1.75. Simply specify a `TargetRubyVersion` >= 3.4 and the `prism` parser translation will be used to analyze your code.
2929

30-
First, specify `prism` in your Gemfile:
31-
32-
```ruby
33-
gem "prism"
34-
```
35-
36-
To use Prism with RuboCop, specify `ParserEngine` and `TargetRubyVersion` in your RuboCop configuration file:
37-
38-
```yaml
39-
AllCops:
40-
ParserEngine: parser_prism
41-
TargetRubyVersion: 3.3
42-
```
43-
44-
The default value for `ParserEngine` is `parser_whitequark`, which indicates the Parser gem. You need to explicitly switch it to `parser_prism` to indicate Prism. Additionally, the value for `TargetRubyVersion` must be specified as `3.3` or higher, as Prism supports parsing versions of Ruby 3.3 and higher.
45-
The parser class is determined by the combination of values for `ParserEngine` and `TargetRubyVersion`. For example, if `TargetRubyVersion: 3.3`, parsing is performed by `Prism::Translation::Parser33`, and for `TargetRubyVersion 3.4`, parsing is performed by `Prism::Translation::Parser34`.
46-
47-
For further information, please refer to the RuboCop documentation:
48-
https://docs.rubocop.org/rubocop/configuration.html#setting-the-parser-engine
30+
Initial support was added in RuboCop 1.62, with an explicit opt-in to use `prism` via the `ParserEngine` configuration. This is no longer necessary.

0 commit comments

Comments
 (0)