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
After upgrading rubocop the following issue is triggered:
An error occurred while Performance/RegexpMatch cop was inspecting
It raises in the following line:
register_purge_url(Card) { card_path('\d+', match.id) if match }
Rubocop version:
$ rubocop -V 0.48.1 (using Parser 2.4.0.0, running on ruby 2.4.1 x86_64-linux)
Stacktrace with rubocop -d:
rubocop -d
An error occurred while Performance/RegexpMatch cop was inspecting /app/models/concerns/varnish_cleaner.rb:268:29. undefined method `type' for nil:NilClass /usr/local/bundle/gems/rubocop-0.48.1/lib/rubocop/cop/performance/regexp_match.rb:69:in `match_method?' /usr/local/bundle/gems/rubocop-0.48.1/lib/rubocop/cop/performance/regexp_match.rb:97:in `match_node?' /usr/local/bundle/gems/rubocop-0.48.1/lib/rubocop/cop/performance/regexp_match.rb:140:in `check_condition' /usr/local/bundle/gems/rubocop-0.48.1/lib/rubocop/cop/performance/regexp_match.rb:110:in `on_if' /usr/local/bundle/gems/rubocop-0.48.1/lib/rubocop/cop/commissioner.rb:43:in `block (2 levels) in on_if' /usr/local/bundle/gems/rubocop-0.48.1/lib/rubocop/cop/commissioner.rb:106:in `with_cop_error_handling' /usr/local/bundle/gems/rubocop-0.48.1/lib/rubocop/cop/commissioner.rb:42:in `block in on_if' /usr/local/bundle/gems/rubocop-0.48.1/lib/rubocop/cop/commissioner.rb:41:in `each' /usr/local/bundle/gems/rubocop-0.48.1/lib/rubocop/cop/commissioner.rb:41:in `on_if' /usr/local/bundle/gems/rubocop-0.48.1/lib/rubocop/ast/traversal.rb:154:in `on_block' /usr/local/bundle/gems/rubocop-0.48.1/lib/rubocop/cop/commissioner.rb:47:in `on_block' (eval):2:in `block in on_begin' (eval):2:in `each' (eval):2:in `on_begin' /usr/local/bundle/gems/rubocop-0.48.1/lib/rubocop/cop/commissioner.rb:47:in `on_begin' /usr/local/bundle/gems/rubocop-0.48.1/lib/rubocop/ast/traversal.rb:141:in `on_while' /usr/local/bundle/gems/rubocop-0.48.1/lib/rubocop/cop/commissioner.rb:47:in `on_module' [25/1892] /usr/local/bundle/gems/rubocop-0.48.1/lib/rubocop/ast/traversal.rb:12:in `walk' /usr/local/bundle/gems/rubocop-0.48.1/lib/rubocop/cop/commissioner.rb:60:in `investigate' /usr/local/bundle/gems/rubocop-0.48.1/lib/rubocop/cop/team.rb:124:in `investigate' /usr/local/bundle/gems/rubocop-0.48.1/lib/rubocop/cop/team.rb:112:in `offenses' /usr/local/bundle/gems/rubocop-0.48.1/lib/rubocop/cop/team.rb:54:in `inspect_file' /usr/local/bundle/gems/rubocop-0.48.1/lib/rubocop/runner.rb:248:in `inspect_file' /usr/local/bundle/gems/rubocop-0.48.1/lib/rubocop/runner.rb:195:in `block in do_inspection_loop' /usr/local/bundle/gems/rubocop-0.48.1/lib/rubocop/runner.rb:227:in `block in iterate_until_no_changes' /usr/local/bundle/gems/rubocop-0.48.1/lib/rubocop/runner.rb:220:in `loop' /usr/local/bundle/gems/rubocop-0.48.1/lib/rubocop/runner.rb:220:in `iterate_until_no_changes' /usr/local/bundle/gems/rubocop-0.48.1/lib/rubocop/runner.rb:191:in `do_inspection_loop' /usr/local/bundle/gems/rubocop-0.48.1/lib/rubocop/runner.rb:101:in `block in file_offenses' /usr/local/bundle/gems/rubocop-0.48.1/lib/rubocop/runner.rb:111:in `file_offense_cache' /usr/local/bundle/gems/rubocop-0.48.1/lib/rubocop/runner.rb:99:in `file_offenses' /usr/local/bundle/gems/rubocop-0.48.1/lib/rubocop/runner.rb:90:in `process_file' /usr/local/bundle/gems/rubocop-0.48.1/lib/rubocop/runner.rb:68:in `block in each_inspected_file' /usr/local/bundle/gems/rubocop-0.48.1/lib/rubocop/runner.rb:65:in `each' /usr/local/bundle/gems/rubocop-0.48.1/lib/rubocop/runner.rb:65:in `reduce' /usr/local/bundle/gems/rubocop-0.48.1/lib/rubocop/runner.rb:65:in `each_inspected_file' /usr/local/bundle/gems/rubocop-0.48.1/lib/rubocop/runner.rb:57:in `inspect_files' /usr/local/bundle/gems/rubocop-0.48.1/lib/rubocop/runner.rb:36:in `run' /usr/local/bundle/gems/rubocop-0.48.1/lib/rubocop/cli.rb:72:in `execute_runner' /usr/local/bundle/gems/rubocop-0.48.1/lib/rubocop/cli.rb:27:in `run' /usr/local/bundle/gems/rubocop-0.48.1/bin/rubocop:13:in `block in <top (required)>' /usr/local/lib/ruby/2.4.0/benchmark.rb:308:in `realtime' /usr/local/bundle/gems/rubocop-0.48.1/bin/rubocop:12:in `<top (required)>' /usr/local/bundle/bin/rubocop:17:in `load' /usr/local/bundle/bin/rubocop:17:in `<main>'
The text was updated successfully, but these errors were encountered:
I can't reproduce this with RuboCop 0.49.
Sorry, something went wrong.
We need to specify TargetRubyVersion to reproduce this error.
TargetRubyVersion
AllCops: TargetRubyVersion: 2.4
minimum code to reproduce: a if match
a if match
[Fix rubocop#4407] Prevent Performance/RegexpMatch from blowing up …
Performance/RegexpMatch
b494eac
…on `match` without arguments
match
dffb69e
No branches or pull requests
After upgrading rubocop the following issue is triggered:
It raises in the following line:
Rubocop version:
Stacktrace with
rubocop -d
:The text was updated successfully, but these errors were encountered: