Closed
Description
Layout/IndentFirstParameter
crashes on the following code:
module Foo
def bar(
arg: nil
)
true
end
end
Scanning /Users/noah/dev/test.rb
An error occurred while Layout/IndentFirstParameter cop was inspecting /Users/noah/dev/test.rb:2:2.
Unknown style special_for_inner_method_call_in_parentheses selected!
/Users/noah/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/rubocop-0.68.0/lib/rubocop/cop/mixin/configurable_enforced_style.rb:67:in `style'
Expected behavior
Don't crash, potentially throw a linting error.
Actual behavior
Crashes.
Steps to reproduce the problem
See code above.
RuboCop version
$ rubocop -V
0.68.0 (using Parser 2.6.3.0, running on ruby 2.5.3 x86_64-darwin18)
Activity
mensfeld commentedon Apr 29, 2019
Can confirm. Same on my side.
bbatsov commentedon Apr 29, 2019
@maxh Can you take a look? Seems we'll need to do a quick bugfix release for this.
erikjenks commentedon Apr 29, 2019
Can confirm seeing this with
ruby 2.6.0
as wellDarhazer commentedon Apr 29, 2019
The EnforcedStyle should be set to either
consistent
oralign_parentheses
.Might be used as a workaround (set EnforcedStyle for the cop in .rubocop.yml) until a new version is released
phene commentedon Apr 29, 2019
Neither
consistent
noralign_parentheses
enforces the style used in the example above. I ended up disabling it until it's fixed.[Fix rubocop#6992] Fix unknown default configuration for Layout/Inden…
maxh commentedon May 22, 2019
Sorry to miss this! Thanks for the fix, @Drenmi. I've reconfigured my GitHub settings so I am properly notified about messages in this repo. I just noticed #6936 and created #7072. Feel free to tag me if there's anything else I should look into -- I should see it now.