Skip to content

Layout/IndentFirstParameter crashing on method definition #6992

Closed
@NoahTheDuke

Description

@NoahTheDuke

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

mensfeld commented on Apr 29, 2019

@mensfeld

Can confirm. Same on my side.

bbatsov

bbatsov commented on Apr 29, 2019

@bbatsov
Collaborator

@maxh Can you take a look? Seems we'll need to do a quick bugfix release for this.

erikjenks

erikjenks commented on Apr 29, 2019

@erikjenks

Can confirm seeing this with ruby 2.6.0 as well

Darhazer

Darhazer commented on Apr 29, 2019

@Darhazer
Member

The EnforcedStyle should be set to either consistent or align_parentheses.
Might be used as a workaround (set EnforcedStyle for the cop in .rubocop.yml) until a new version is released

phene

phene commented on Apr 29, 2019

@phene

Neither consistent nor align_parentheses enforces the style used in the example above. I ended up disabling it until it's fixed.

added a commit that references this issue on Apr 30, 2019

[Fix rubocop#6992] Fix unknown default configuration for Layout/Inden…

90718e2
maxh

maxh commented on May 22, 2019

@maxh
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @koic@bbatsov@phene@mensfeld@NoahTheDuke

        Issue actions

          Layout/IndentFirstParameter crashing on method definition · Issue #6992 · rubocop/rubocop