Repository: presidentbeef/brakeman

Issue #1449: Parse error on shorthand arguments forwarding
Created: 2020-01-13T10:13:24Z
Background
Brakeman version: 4.7.2
Rails version: 6.0.2.1
Ruby version: 2.7.0p0
Link to Rails application code: -
Parse Error
It fails to parse ruby's 2.7 new arguments forwarding shortand ... (see https://blog.saeloun.com/2019/12/04/ruby-2-7-adds-new-operator-for-arguments-forwarding.html for some background information).
Minimal example that does not parse:
def some_method(...)
  some_other_method(...)
end

def some_other_method(name)
  pp name
end
Error: path/to/file.rb:1 :: parse error on value "..." (tDOT3)

Duplicate issue #1576: Ruby 3.0 argument forwarding breaks parsing
Created: 2021-03-05T08:41:51Z
Background
Brakeman version: 5.0.0
Rails version: 6.1.3
Ruby version: 3.0.0
Issue
def association(association, ...)
  field(association, ...)
end
Other Error
Error: app/graphql/concerns/object_helpers.rb:11 :: parse error on value "..." (tDOT3) Could not parse app/graphql/concerns/object_helpers.rb
Location: ~/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/racc-1.5.2/lib/racc/parser.rb:538:in `on_error'
~/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/brakeman-5.0.0/bundle/ruby/2.7.0/gems/ruby_parser-3.15.1/lib/ruby_parser_extras.rb:1304:in `on_error'
(eval):3:in `_racc_do_parse_c'
(eval):3:in `do_parse'
~/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/brakeman-5.0.0/bundle/ruby/2.7.0/gems/ruby_parser-3.15.1/lib/ruby_parser_extras.rb:1329:in `block in process'
~/.rbenv/versions/3.0.0/lib/ruby/3.0.0/timeout.rb:97:in `block in timeout'
~/.rbenv/versions/3.0.0/lib/ruby/3.0.0/timeout.rb:35:in `block in catch'
~/.rbenv/versions/3.0.0/lib/ruby/3.0.0/timeout.rb:35:in `catch'
~/.rbenv/versions/3.0.0/lib/ruby/3.0.0/timeout.rb:35:in `catch'
~/.rbenv/versions/3.0.0/lib/ruby/3.0.0/timeout.rb:112:in `timeout'
~/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/brakeman-5.0.0/bundle/ruby/2.7.0/gems/ruby_parser-3.15.1/lib/ruby_parser_extras.rb:1317:in `process'
~/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/brakeman-5.0.0/bundle/ruby/2.7.0/gems/ruby_parser-3.15.1/lib/ruby_parser.rb:36:in `block in process'
~/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/brakeman-5.0.0/bundle/ruby/2.7.0/gems/ruby_parser-3.15.1/lib/ruby_parser.rb:33:in `each'
~/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/brakeman-5.0.0/bundle/ruby/2.7.0/gems/ruby_parser-3.15.1/lib/ruby_parser.rb:33:in `process'
~/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/brakeman-5.0.0/lib/brakeman/file_parser.rb:43:in `parse_ruby'
~/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/brakeman-5.0.0/lib/brakeman/file_parser.rb:17:in `block in parse_files'
~/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/brakeman-5.0.0/lib/brakeman/file_parser.rb:27:in `block in read_files'
~/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/brakeman-5.0.0/lib/brakeman/file_parser.rb:24:in `each'
~/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/brakeman-5.0.0/lib/brakeman/file_parser.rb:24:in `read_files'
~/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/brakeman-5.0.0/lib/brakeman/file_parser.rb:16:in `parse_files'
~/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/brakeman-5.0.0/lib/brakeman/scanner.rb:76:in `parse_files'
~/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/brakeman-5.0.0/lib/brakeman/scanner.rb:49:in `process'
~/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/brakeman-5.0.0/lib/brakeman.rb:379:in `scan'
~/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/brakeman-5.0.0/lib/brakeman.rb:85:in `run'
~/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/brakeman-5.0.0/lib/brakeman/commandline.rb:157:in `run_brakeman'
~/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/brakeman-5.0.0/lib/brakeman/commandline.rb:125:in `regular_report'
~/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/brakeman-5.0.0/lib/brakeman/commandline.rb:166:in `run_report'
~/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/brakeman-5.0.0/lib/brakeman/commandline.rb:35:in `run'
~/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/brakeman-5.0.0/lib/brakeman/commandline.rb:20:in `start'
~/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/brakeman-5.0.0/bin/brakeman:10:in `<top (required)>'
~/.rbenv/versions/3.0.0/bin/brakeman:23:in `load'
~/.rbenv/versions/3.0.0/bin/brakeman:23:in `<main>'

Closing comment (2021-04-26T03:26:05Z): @klausbadelt this is closed because it's a duplicate of #1449