You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using master - 0.29.1 (using Parser 2.2.0.3, running on ruby 2.2.0 x86_64-darwin14)
The Style/MissingElse cop causes the offense report to crash:
<file>.rb:9:5: C: if condition requires an else-clause.
undefined method `source_line' for #<Parser::Source::Map::Condition:0x007fde525c2140>
<path>/.rvm/gems/ruby-2.2.0@<gemset>/bundler/gems/rubocop-f52bc7e2ec4b/lib/rubocop/formatter/clang_style_formatter.rb:15:in `block in report_file'
The fix seems to be to pass :expression as the second argument to add_offense (instead of node.location). I will submit a PR with the fix soon.
I noticed that when an exception occurs during inspection, it's caught and a message is displayed (An error occurred while <cop> cop was inspecting <file>.). Should something similar be done during reporting? Or is there another way we could catch an issue like this ahead of time? Is there a type of spec that tests reporting missing for this cop?
The text was updated successfully, but these errors were encountered:
I'm using master -
0.29.1 (using Parser 2.2.0.3, running on ruby 2.2.0 x86_64-darwin14)
The
Style/MissingElse
cop causes the offense report to crash:The fix seems to be to pass
:expression
as the second argument toadd_offense
(instead ofnode.location
). I will submit a PR with the fix soon.I noticed that when an exception occurs during inspection, it's caught and a message is displayed (
An error occurred while <cop> cop was inspecting <file>.
). Should something similar be done during reporting? Or is there another way we could catch an issue like this ahead of time? Is there a type of spec that tests reporting missing for this cop?The text was updated successfully, but these errors were encountered: