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

Accept super within ranges for Layout/SpaceAroundKeyword cop #11331

Merged
merged 1 commit into from Dec 25, 2022

Conversation

fatkodima
Copy link
Contributor

Fixes #8751.

For the following

1..super

An infinite loop is detected:

Infinite loop detected in snippet.rb and caused by Layout/SpaceAroundKeyword -> Layout/SpaceInsideRangeLiteral
rubocop/lib/rubocop/runner.rb:311:in `check_for_infinite_loop'
rubocop/lib/rubocop/runner.rb:294:in `block in iterate_until_no_changes'
rubocop/lib/rubocop/runner.rb:293:in `loop'
rubocop/lib/rubocop/runner.rb:293:in `iterate_until_no_changes'

@koic
Copy link
Member

koic commented Dec 25, 2022

Can you add a repro test for the infinite loop error to spec/rubocop/cli/autocorrect_spec.rb? e.g. #9777

@fatkodima fatkodima force-pushed the space_around_keyword-super-ranges branch from 448a923 to 5dfb66e Compare December 25, 2022 16:05
@fatkodima
Copy link
Contributor Author

Can you add a repro test for the infinite loop error to spec/rubocop/cli/autocorrect_spec.rb? e.g. #9777

Added.

@koic koic merged commit 4dc9afc into rubocop:master Dec 25, 2022
@fatkodima fatkodima deleted the space_around_keyword-super-ranges branch December 25, 2022 19:19
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.

Layout/SpaceAroundOperators Infinite loop
2 participants