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 #12547] User experience for infinite loop detected #12655

Conversation

Hiroto-Iizuka
Copy link
Contributor

@Hiroto-Iizuka Hiroto-Iizuka commented Jan 26, 2024

#12547

This pull request includes the following:

  • Added a comment suggesting to upgrade Rubocop to the latest version in case of "Infinite loop detected" error.
  • Modified RSpec accordingly.

Before submitting the PR make sure the following are checked:

  • The PR relates to only one subject with a clear title and description in grammatically correct, complete sentences.
  • Wrote good commit messages.
  • Commit message starts with [Fix #issue-number] (if the related issue exists).
  • Feature branch is up-to-date with master (if not - rebase it).
  • Squashed related commits together.
  • Added tests.
  • Ran bundle exec rake default. It executes all tests and runs RuboCop on its own code.
  • Added an entry (file) to the changelog folder named {change_type}_{change_description}.md if the new code introduces user-observable changes. See changelog entry format for details.

@Hiroto-Iizuka Hiroto-Iizuka marked this pull request as draft January 26, 2024 09:30
@Hiroto-Iizuka Hiroto-Iizuka force-pushed the User-experience-for-Infinite_loop_detected branch from 3f7880a to 60b24d1 Compare January 27, 2024 05:55
@Hiroto-Iizuka Hiroto-Iizuka changed the title User experience for infinite loop detected [Fix rubocop#12547] User experience for infinite loop detected Jan 27, 2024
@Hiroto-Iizuka Hiroto-Iizuka marked this pull request as ready for review January 27, 2024 06:05
@Hiroto-Iizuka Hiroto-Iizuka changed the title [Fix rubocop#12547] User experience for infinite loop detected [Fix #12547] User experience for infinite loop detected Jan 27, 2024
@@ -20,6 +20,9 @@ def initialize(path, offenses_by_iteration, loop_start: -1)
message = 'Infinite loop detected'
message += " in #{path}" if path
message += " and caused by #{root_cause}" if root_cause
message += ' \n\nPlease update to the latest RuboCop version if not already in use,'
message += ' \nand report a bug if the issue still occurs on this version.'
message += ' \n\nPlease check the latest version at "https://rubygems.org/gems/rubocop"'
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd suggest dropping the quotes around the URL.

@@ -20,6 +20,9 @@ def initialize(path, offenses_by_iteration, loop_start: -1)
message = 'Infinite loop detected'
message += " in #{path}" if path
message += " and caused by #{root_cause}" if root_cause
message += ' \n\nPlease update to the latest RuboCop version if not already in use,'
Copy link
Contributor

Choose a reason for hiding this comment

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

It might be problematic to have newlines here, especially if other programs need to consume the output. The maintainers can probably say more.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@andyw8

Thanks for the review!
I rewrote it in a form without line breaks.

@andyw8
Copy link
Contributor

andyw8 commented Jan 30, 2024

Nice!

@Hiroto-Iizuka Hiroto-Iizuka force-pushed the User-experience-for-Infinite_loop_detected branch from b83e715 to 9549f0f Compare January 30, 2024 23:01
@andyw8
Copy link
Contributor

andyw8 commented Feb 6, 2024

@koic any thoughts?

@bbatsov bbatsov merged commit ebcc72a into rubocop:master Apr 8, 2024
22 checks passed
@bbatsov
Copy link
Collaborator

bbatsov commented Apr 8, 2024

I think that's a good small improvement. Sorry for taking so long to merge this!

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

Successfully merging this pull request may close these issues.

None yet

3 participants