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
This code does not cause the described error below.
class EventTest < ActiveSupport::TestCase test '#call' do assert_match /confirmed order/, event.description end end
I got this error:
Inspecting 1 file Scanning ~/event_test.rb An error occurred while Lint/AmbiguousRegexpLiteral cop was inspecting ~/event_test.rb. undefined method `receiver' for nil:NilClass ~/.gem/ruby/2.7.1/gems/rubocop-0.93.0/lib/rubocop/cop/lint/ambiguous_regexp_literal.rb:64:in `method_chain_to_regexp_receiver?' ~/.gem/ruby/2.7.1/gems/rubocop-0.93.0/lib/rubocop/cop/lint/ambiguous_regexp_literal.rb:56:in `find_offense_node' ~/.gem/ruby/2.7.1/gems/rubocop-0.93.0/lib/rubocop/cop/lint/ambiguous_regexp_literal.rb:50:in `find_offense_node_by' ~/.gem/ruby/2.7.1/gems/rubocop-0.93.0/lib/rubocop/cop/lint/ambiguous_regexp_literal.rb:35:in `block in on_new_investigation' ~/.gem/ruby/2.7.1/gems/rubocop-0.93.0/lib/rubocop/cop/lint/ambiguous_regexp_literal.rb:32:in `each' ~/.gem/ruby/2.7.1/gems/rubocop-0.93.0/lib/rubocop/cop/lint/ambiguous_regexp_literal.rb:32:in `on_new_investigation' ~/.gem/ruby/2.7.1/gems/rubocop-0.93.0/lib/rubocop/cop/commissioner.rb:143:in `block (2 levels) in invoke' ~/.gem/ruby/2.7.1/gems/rubocop-0.93.0/lib/rubocop/cop/commissioner.rb:152:in `with_cop_error_handling' ~/.gem/ruby/2.7.1/gems/rubocop-0.93.0/lib/rubocop/cop/commissioner.rb:142:in `block in invoke' ~/.gem/ruby/2.7.1/gems/rubocop-0.93.0/lib/rubocop/cop/commissioner.rb:141:in `each' ~/.gem/ruby/2.7.1/gems/rubocop-0.93.0/lib/rubocop/cop/commissioner.rb:141:in `invoke' ~/.gem/ruby/2.7.1/gems/rubocop-0.93.0/lib/rubocop/cop/commissioner.rb:83:in `investigate' ~/.gem/ruby/2.7.1/gems/rubocop-0.93.0/lib/rubocop/cop/team.rb:152:in `investigate_partial' ~/.gem/ruby/2.7.1/gems/rubocop-0.93.0/lib/rubocop/cop/team.rb:83:in `investigate' ~/.gem/ruby/2.7.1/gems/rubocop-0.93.0/lib/rubocop/runner.rb:315:in `inspect_file' ~/.gem/ruby/2.7.1/gems/rubocop-0.93.0/lib/rubocop/runner.rb:259:in `block in do_inspection_loop' ~/.gem/ruby/2.7.1/gems/rubocop-0.93.0/lib/rubocop/runner.rb:293:in `block in iterate_until_no_changes' ~/.gem/ruby/2.7.1/gems/rubocop-0.93.0/lib/rubocop/runner.rb:286:in `loop' ~/.gem/ruby/2.7.1/gems/rubocop-0.93.0/lib/rubocop/runner.rb:286:in `iterate_until_no_changes' ~/.gem/ruby/2.7.1/gems/rubocop-0.93.0/lib/rubocop/runner.rb:255:in `do_inspection_loop' ~/.gem/ruby/2.7.1/gems/rubocop-0.93.0/lib/rubocop/runner.rb:132:in `block in file_offenses' ~/.gem/ruby/2.7.1/gems/rubocop-0.93.0/lib/rubocop/runner.rb:157:in `file_offense_cache' ~/.gem/ruby/2.7.1/gems/rubocop-0.93.0/lib/rubocop/runner.rb:131:in `file_offenses' ~/.gem/ruby/2.7.1/gems/rubocop-0.93.0/lib/rubocop/runner.rb:122:in `process_file' ~/.gem/ruby/2.7.1/gems/rubocop-0.93.0/lib/rubocop/runner.rb:101:in `block in each_inspected_file' ~/.gem/ruby/2.7.1/gems/rubocop-0.93.0/lib/rubocop/runner.rb:100:in `each' ~/.gem/ruby/2.7.1/gems/rubocop-0.93.0/lib/rubocop/runner.rb:100:in `reduce' ~/.gem/ruby/2.7.1/gems/rubocop-0.93.0/lib/rubocop/runner.rb:100:in `each_inspected_file' ~/.gem/ruby/2.7.1/gems/rubocop-0.93.0/lib/rubocop/runner.rb:86:in `inspect_files' ~/.gem/ruby/2.7.1/gems/rubocop-0.93.0/lib/rubocop/runner.rb:47:in `run' ~/.gem/ruby/2.7.1/gems/rubocop-0.93.0/lib/rubocop/cli/command/execute_runner.rb:25:in `execute_runner' ~/.gem/ruby/2.7.1/gems/rubocop-0.93.0/lib/rubocop/cli/command/execute_runner.rb:17:in `run' ~/.gem/ruby/2.7.1/gems/rubocop-0.93.0/lib/rubocop/cli/command.rb:11:in `run' ~/.gem/ruby/2.7.1/gems/rubocop-0.93.0/lib/rubocop/cli/environment.rb:18:in `run' ~/.gem/ruby/2.7.1/gems/rubocop-0.93.0/lib/rubocop/cli.rb:65:in `run_command' ~/.gem/ruby/2.7.1/gems/rubocop-0.93.0/lib/rubocop/cli.rb:72:in `execute_runners' ~/.gem/ruby/2.7.1/gems/rubocop-0.93.0/lib/rubocop/cli.rb:41:in `run' ~/.gem/ruby/2.7.1/gems/rubocop-0.93.0/exe/rubocop:13:in `block in <top (required)>' ~/.rubies/ruby-2.7.1/lib/ruby/2.7.0/benchmark.rb:308:in `realtime' ~/.gem/ruby/2.7.1/gems/rubocop-0.93.0/exe/rubocop:12:in `<top (required)>' ~/.gem/ruby/2.7.1/bin/rubocop:23:in `load' ~/.gem/ruby/2.7.1/bin/rubocop:23:in `<main>'
rubocop -d event_test.rb --only Lint/AmbiguousRegexpLiteral
$ rubocop -V 0.93.0 (using Parser 2.7.2.0, rubocop-ast 0.7.1, running on ruby 2.7.1 x86_64-darwin18)
The text was updated successfully, but these errors were encountered:
Note: there's already an open PR for this cop: #8708
Sorry, something went wrong.
Lint/AmbiguousRegexpLiteral
This issue is a recent regression by #8847 💦
Lint/OutOfRangeRegexpRef
[Fix rubocop#8862] Fix an error for Lint/AmbiguousRegexpLiteral
e36f120
Fixes rubocop#8862. This PR fixes an error for `Lint/AmbiguousRegexpLiteral` when using regexp without method calls in nested structure.
Merge pull request #8863 from koic/fix_error_for_ambiguous_regexp_lit…
f79e1c0
…eral [Fix #8862] Fix an error for `Lint/AmbiguousRegexpLiteral`
Successfully merging a pull request may close this issue.
Expected behavior
This code does not cause the described error below.
Actual behavior
I got this error:
Steps to reproduce the problem
RuboCop version
The text was updated successfully, but these errors were encountered: