Skip to content
New issue

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

An error occurred while Lint/SuppressedException cop was inspecting #8011

Closed
jkr2255 opened this issue May 22, 2020 · 1 comment
Closed

An error occurred while Lint/SuppressedException cop was inspecting #8011

jkr2255 opened this issue May 22, 2020 · 1 comment

Comments

@jkr2255
Copy link

jkr2255 commented May 22, 2020

Rubocop breaks while checking Lint/SuppressedException.


Expected behavior

Success normally, offences depend on Lint/SuppressedException settings.

Actual behavior

An error occurred while Lint/SuppressedException cop was inspecting /path/to/file.rb:7:2.
/home/user/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/rubocop-0.84.0/lib/rubocop/cop/lint/suppressed_exception.rb:85:in `comment_between_rescue_and_end?'
/home/user/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/rubocop-0.84.0/lib/rubocop/cop/lint/suppressed_exception.rb:72:in `on_resbody'
/home/user/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/rubocop-0.84.0/lib/rubocop/cop/commissioner.rb:57:in `block (2 levels) in trigger_responding_cops'
/home/user/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/rubocop-0.84.0/lib/rubocop/cop/commissioner.rb:136:in `with_cop_error_handling'
/home/user/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/rubocop-0.84.0/lib/rubocop/cop/commissioner.rb:56:in `block in trigger_responding_cops'
/home/user/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/rubocop-0.84.0/lib/rubocop/cop/commissioner.rb:55:in `each'
/home/user/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/rubocop-0.84.0/lib/rubocop/cop/commissioner.rb:55:in `trigger_responding_cops'
/home/user/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/rubocop-0.84.0/lib/rubocop/cop/commissioner.rb:32:in `block (2 levels) in <class:Commissioner>'
/home/user/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/rubocop-ast-0.0.3/lib/rubocop/ast/traversal.rb:176:in `block in on_case'
/home/user/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/rubocop-ast-0.0.3/lib/rubocop/ast/traversal.rb:175:in `each'
/home/user/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/rubocop-ast-0.0.3/lib/rubocop/ast/traversal.rb:175:in `on_case'
/home/user/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/rubocop-0.84.0/lib/rubocop/cop/commissioner.rb:33:in `block (2 levels) in <class:Commissioner>'
/home/user/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/rubocop-ast-0.0.3/lib/rubocop/ast/traversal.rb:107:in `on_def'
/home/user/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/rubocop-0.84.0/lib/rubocop/cop/commissioner.rb:33:in `block (2 levels) in <class:Commissioner>'
/home/user/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/rubocop-ast-0.0.3/lib/rubocop/ast/traversal.rb:157:in `on_while'
/home/user/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/rubocop-0.84.0/lib/rubocop/cop/commissioner.rb:33:in `block (2 levels) in <class:Commissioner>'
/home/user/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/rubocop-ast-0.0.3/lib/rubocop/ast/traversal.rb:14:in `walk'
/home/user/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/rubocop-0.84.0/lib/rubocop/cop/commissioner.rb:44:in `investigate'
/home/user/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/rubocop-0.84.0/lib/rubocop/cop/team.rb:124:in `investigate'
/home/user/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/rubocop-0.84.0/lib/rubocop/cop/team.rb:112:in `offenses'
/home/user/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/rubocop-0.84.0/lib/rubocop/cop/team.rb:44:in `inspect_file'
/home/user/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/rubocop-0.84.0/lib/rubocop/runner.rb:295:in `inspect_file'
/home/user/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/rubocop-0.84.0/lib/rubocop/runner.rb:245:in `block in do_inspection_loop'
/home/user/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/rubocop-0.84.0/lib/rubocop/runner.rb:277:in `block in iterate_until_no_changes'
/home/user/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/rubocop-0.84.0/lib/rubocop/runner.rb:270:in `loop'
/home/user/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/rubocop-0.84.0/lib/rubocop/runner.rb:270:in `iterate_until_no_changes'
/home/user/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/rubocop-0.84.0/lib/rubocop/runner.rb:241:in `do_inspection_loop'
/home/user/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/rubocop-0.84.0/lib/rubocop/runner.rb:122:in `block in file_offenses'
/home/user/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/rubocop-0.84.0/lib/rubocop/runner.rb:146:in `file_offense_cache'
/home/user/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/rubocop-0.84.0/lib/rubocop/runner.rb:120:in `file_offenses'
/home/user/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/rubocop-0.84.0/lib/rubocop/runner.rb:111:in `process_file'
/home/user/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/rubocop-0.84.0/lib/rubocop/runner.rb:90:in `block in each_inspected_file'
/home/user/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/rubocop-0.84.0/lib/rubocop/runner.rb:89:in `each'
/home/user/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/rubocop-0.84.0/lib/rubocop/runner.rb:89:in `reduce'
/home/user/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/rubocop-0.84.0/lib/rubocop/runner.rb:89:in `each_inspected_file'
/home/user/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/rubocop-0.84.0/lib/rubocop/runner.rb:78:in `inspect_files'
/home/user/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/rubocop-0.84.0/lib/rubocop/runner.rb:39:in `run'
/home/user/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/rubocop-0.84.0/lib/rubocop/cli/command/execute_runner.rb:21:in `execute_runner'
/home/user/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/rubocop-0.84.0/lib/rubocop/cli/command/execute_runner.rb:13:in `run'
/home/user/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/rubocop-0.84.0/lib/rubocop/cli/command.rb:10:in `run'
/home/user/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/rubocop-0.84.0/lib/rubocop/cli/environment.rb:17:in `run'
/home/user/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/rubocop-0.84.0/lib/rubocop/cli.rb:65:in `run_command'
/home/user/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/rubocop-0.84.0/lib/rubocop/cli.rb:72:in `execute_runners'
/home/user/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/rubocop-0.84.0/lib/rubocop/cli.rb:41:in `run'
/home/user/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/rubocop-0.84.0/exe/rubocop:13:in `block in <top (required)>'
/home/user/.rbenv/versions/2.5.1/lib/ruby/2.5.0/benchmark.rb:308:in `realtime'
/home/user/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/rubocop-0.84.0/exe/rubocop:12:in `<top (required)>'
/home/user/.rbenv/versions/2.5.1/bin/rubocop:23:in `load'
/home/user/.rbenv/versions/2.5.1/bin/rubocop:23:in `<main>'


Steps to reproduce the problem

rubocop following-file.rb (reproduced with no .rubocop.yml present)

# frozen_string_literal: true

# foo
module SomeModule
  def some_method
    'abc'
  rescue Exception
    # English
  end
end

(In 0.82.0, this produced no error.)

RuboCop version

$ [bundle exec] rubocop -V
0.84.0 (using Parser 2.7.1.2, rubocop-ast 0.0.3, running on ruby 2.5.1 x86_64-linux)
@koic
Copy link
Member

koic commented May 22, 2020

Dup with #8008 and fixed by #8010. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants