-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Infinite loop detected in /Users/robert/gh/lab42/tmp/example.rb and caused by Layout/IndentationConsistency -> Layout/IndentationWidth #10396
Comments
Oh here is the state of the partially corrected file when rubocop crashes # frozen_string_literal: true
require_relative "tag_cloud/compiler"
module Lab42
module TagCloud extend self
def color_value(color_spec)
Compiler.color_value(color_spec.to_s)
end
end
end
# SPDX-License-Identifier: Apache-2.0 |
after some tinkering I found out that the |
I reproduced this problem disabling Style/TrailingBodyOnModule. The code to reproduce. module Foo extend Bar
something
end
# Got this error:
# Infinite loop detected in /path/to/example.rb and caused by Layout/IndentationConsistency -> Layout/IndentationWidth
# Things following the module name doesn't have to be `extend`. This code causes the same error.
#
# module Foo bar
# something
# end The autocorrect works with no errors when module Foo
extend Bar
something
end Should we fix There is the same problem with the class definition when class Foo bar
something
end |
…leave module/class body unchanged to avoid infinite autocorrect loop with `Layout/IndentationConsistency` when the body trails after class/module definition
…odule/class body unchanged to avoid infinite autocorrect loop with `Layout/IndentationConsistency` when the body trails after class/module definition
Expected behavior
Autocorect
Actual behavior
Crash
Steps to reproduce the problem
RuboCop version
Include the output of
rubocop -V
orbundle exec rubocop -V
if using Bundler.If you see extension cop versions (e.g.
rubocop-performance
,rubocop-rspec
, and others)output by
rubocop -V
, include them as well. Here's an example:resources.zip
The text was updated successfully, but these errors were encountered: