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

Print file name on any error from RipperRubyParser, not just SyntaxError #16112

Merged
merged 2 commits into from
Oct 9, 2017

Conversation

cben
Copy link
Contributor

@cben cben commented Oct 3, 2017

RipperRubyParser sometimes throws a non-specific RuntimeError. E.g.
mvz/ripper_ruby_parser#3,
mvz/ripper_ruby_parser#5
Whether a real syntax error or a bug, to diagnose we need to see file name
(line and column are normally clear from exception).

  • Pass file name to parser. Don't see it in exceptions though...
  • Change rescue to print file name on any (StandardError) errors from parsing.

begin
parsed = RipperRubyParser::Parser.new.parse(content)
rescue => e
puts "\nError parsing classes in #{filename}:\n#{e.class.name}: #{e}\n\n"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should it be STDERR.puts?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done (used $stderr, it's my impression that's more polite because easily re-assignable)

@miq-bot
Copy link
Member

miq-bot commented Oct 7, 2017

Some comments on commits cben/manageiq@788614b~...217dae0

lib/extensions/descendant_loader.rb

  • ⚠️ - 77 - Detected puts. Remove all debugging statements.

@miq-bot
Copy link
Member

miq-bot commented Oct 7, 2017

Checked commits cben/manageiq@788614b~...217dae0 with ruby 2.3.3, rubocop 0.47.1, and haml-lint 0.20.0
1 file checked, 0 offenses detected
Everything looks fine. 👍

@bdunne bdunne merged commit a8b40ad into ManageIQ:master Oct 9, 2017
@bdunne bdunne added the fine/no label Oct 9, 2017
@bdunne bdunne added this to the Sprint 71 Ending Oct 16, 2017 milestone Oct 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants