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

Layout/IndentFirstParameter crashing on method definition #6992

Closed
NoahTheDuke opened this issue Apr 29, 2019 · 6 comments
Closed

Layout/IndentFirstParameter crashing on method definition #6992

NoahTheDuke opened this issue Apr 29, 2019 · 6 comments
Labels

Comments

@NoahTheDuke
Copy link

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)
@mensfeld
Copy link

Can confirm. Same on my side.

@bbatsov
Copy link
Collaborator

bbatsov commented Apr 29, 2019

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

@koic koic added the bug label Apr 29, 2019
@erikjenks
Copy link

Can confirm seeing this with ruby 2.6.0 as well

@Darhazer
Copy link
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
Copy link

phene commented Apr 29, 2019

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

Drenmi added a commit to Drenmi/rubocop that referenced this issue Apr 30, 2019
…tFirstParameter

Looks like most likely a mistake when copying the configuration from
`Layout/IndentFirstArgument` to `Layout/IndentFirstParameter`.
@maxh
Copy link
Contributor

maxh commented 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.

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

No branches or pull requests

8 participants