Skip to content

Commit

Permalink
Merge pull request #11742 from composerinteralia/bundler-standalone-e…
Browse files Browse the repository at this point in the history
…rror-reporting

Fix error when trying to display error message
  • Loading branch information
koic authored Mar 29, 2023
2 parents 3908944 + d6bc76a commit 4d52c6a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions changelog/fix_error_handling_in_bundler_standalone_mode.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* [#11742](https://github.com/rubocop/rubocop/pull/11742): Fix error handling in bundler standalone mode. ([@composerinteralia][])
9 changes: 7 additions & 2 deletions lib/rubocop/cli/command/execute_runner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,18 @@ def display_error_summary(errors)
warn <<~WARNING
Errors are usually caused by RuboCop bugs.
Please, report your problems to RuboCop's issue tracker.
#{Gem.loaded_specs['rubocop'].metadata['bug_tracker_uri']}
#{bug_tracker_uri}
Mention the following information in the issue report:
#{RuboCop::Version.version(debug: true)}
WARNING
end

def bug_tracker_uri
return unless Gem.loaded_specs.key?('rubocop')

"#{Gem.loaded_specs['rubocop'].metadata['bug_tracker_uri']}\n"
end

def maybe_print_corrected_source
# Integration tools (like RubyMine) expect to have only the JSON result
# when specifying JSON format. Similar HTML and JUnit are targeted as well.
Expand Down

0 comments on commit 4d52c6a

Please sign in to comment.