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

Fix error when trying to display error message #11742

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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