We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Should be able to handle numbered parameter when specifying TargetRubyVersion 2.7
rubocop command fails with error output
undefined method `on_numblock' for #<RuboCop::Cop::Commissioner:0x00007fcd0eb1d298> Did you mean? on_block
.rubocop.yml
AllCops: TargetRubyVersion: 2.7
test.rb
#!/usr/bin/env ruby # frozen_string_literal: true def hello(meaning) spliters = [',', '.', '!'] spliters.each { meaning = meaning.split(_1).first } meaning.delete('"').strip.gsub("\r\n", '; ') end
Output
$ rubocop test.rb Inspecting 1 file "s(:numblock,\n s(:send,\n s(:lvar, :spliters), :each), 1,\n s(:lvasgn, :meaning,\n s(:send,\n s(:send,\n s(:lvar, :meaning), :split,\n s(:lvar, :_1)), :first)))" . 0 files inspected, no offenses detected undefined method `on_numblock' for #<RuboCop::Cop::Commissioner:0x00007fcd0eb1d298> Did you mean? on_block /Users/justinfeng/.rvm/gems/ruby-2.7.0/gems/rubocop-0.79.0/lib/rubocop/ast/traversal.rb:57:in `block in on_begin' /Users/justinfeng/.rvm/gems/ruby-2.7.0/gems/rubocop-0.79.0/lib/rubocop/ast/traversal.rb:57:in `each' /Users/justinfeng/.rvm/gems/ruby-2.7.0/gems/rubocop-0.79.0/lib/rubocop/ast/traversal.rb:57:in `on_begin'
$ bundle exec rubocop -V 0.79.0 (using Parser 2.7.0.2, running on ruby 2.7.0 x86_64-darwin17)
The text was updated successfully, but these errors were encountered:
[Fix rubocop#7647] Fix an undefined method on_numblock error
undefined method on_numblock
d8c59ba
when using Ruby 2.7's numbered parameters
Merge pull request #7665 from hanachin/fix_7647
7b3639b
[Fix #7647] Handle numblock
Successfully merging a pull request may close this issue.
Expected behavior
Should be able to handle numbered parameter when specifying TargetRubyVersion 2.7
Actual behavior
rubocop command fails with error output
Steps to reproduce the problem
.rubocop.yml
test.rb
Output
RuboCop version
The text was updated successfully, but these errors were encountered: