You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ruby 3.3.0 changed how anonymous args/keyword args can be used and the newly released 3.3.1 contains a bugfix for some unambiguous/unintentional places where they could be safely used, see: https://bugs.ruby-lang.org/issues/20090
Expected behavior
Rubocop is able to parse & validate code that runs on ruby 3.3.1
Actual behavior
Get Lint/Syntax errors such as: Lint/Syntax: anonymous keyword rest parameter is also used within block Lint/Syntax: anonymous rest parameter is also used within block Lint/Syntax: unexpected token $end
❯ bundle exec rubocop --debug
For /Users/<username>/repos/rubocop-repo: Default configuration from /Users/<username>/.asdf/installs/ruby/3.3.0/lib/ruby/gems/3.3.0/gems/rubocop-1.63.3/config/default.yml
Use parallel by default.
Running parallel inspection
Loading cache from /Users/<username>/.cache/rubocop_cache/d8000782e70b69f8ef9f890bf197e06093695a19/6d7a3b621ca1730e04accd938619e4bdab66cfb1/14b887b108489c87a0ce57f4b58361ea46a3fdc3
Loading cache from /Users/<username>/.cache/rubocop_cache/d8000782e70b69f8ef9f890bf197e06093695a19/6d7a3b621ca1730e04accd938619e4bdab66cfb1/88559496eb2db1f6bae77024cd89412cfad0a51c
Inspecting 2 files
Scanning /Users/<username>/repos/rubocop-repo/Gemfile
Loading cache from /Users/<username>/.cache/rubocop_cache/d8000782e70b69f8ef9f890bf197e06093695a19/6d7a3b621ca1730e04accd938619e4bdab66cfb1/14b887b108489c87a0ce57f4b58361ea46a3fdc3
.Scanning /Users/<username>/repos/rubocop-repo/test.rb
Loading cache from /Users/<username>/.cache/rubocop_cache/d8000782e70b69f8ef9f890bf197e06093695a19/6d7a3b621ca1730e04accd938619e4bdab66cfb1/88559496eb2db1f6bae77024cd89412cfad0a51c
F
Offenses:
test.rb:3:10: F: Lint/Syntax: anonymous keyword rest parameter is also used within block
(Using Ruby 3.3 parser; configure using TargetRubyVersion parameter, under AllCops)
puts(**)
^^
test.rb:11:10: F: Lint/Syntax: anonymous rest parameter is also used within block
(Using Ruby 3.3 parser; configure using TargetRubyVersion parameter, under AllCops)
puts(*)
^
test.rb:16:1: F: Lint/Syntax: unexpected token $end
(Using Ruby 3.3 parser; configure using TargetRubyVersion parameter, under AllCops)
2 files inspected, 3 offenses detected
Finished in 0.08651399999507703 seconds
The versions ranges on rubocop allow for an updated version of the parser gem, https://github.com/whitequark/parser/releases/tag/v3.3.1.0 - but anyone who's on 3.3.0 may want to stick with previous version of parser, it doesn't have differences for patch versions of ruby.
Ruby 3.3.0 changed how anonymous args/keyword args can be used and the newly released 3.3.1 contains a bugfix for some unambiguous/unintentional places where they could be safely used, see: https://bugs.ruby-lang.org/issues/20090
Expected behavior
Rubocop is able to parse & validate code that runs on ruby 3.3.1
Actual behavior
Get
Lint/Syntax
errors such as:Lint/Syntax: anonymous keyword rest parameter is also used within block
Lint/Syntax: anonymous rest parameter is also used within block
Lint/Syntax: unexpected token $end
Steps to reproduce the problem
Here's a sample test case: (there are more in https://bugs.ruby-lang.org/issues/20090)
The code works on ruby 3.3.1 (and did on 3.2), but not 3.3.0:
RuboCop version
The text was updated successfully, but these errors were encountered: