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

Style/Lambda incorrectly autocorrects multiline lambdas in keyword arguments #3349

Closed
metcalf opened this issue Jul 27, 2016 · 0 comments
Closed

Comments

@metcalf
Copy link

metcalf commented Jul 27, 2016

Expected behavior

Given:

foo bar: ->(x) do
  x * 2
end

Rubocop should either not autocorrect, or wrap the autocorrected lambda in parentheses:

foo fr: (lambda do |x|
  x * 2
end)

Actual behavior

Corrects to:

foo fr: lambda do |x|
  x * 2
end

Steps to reproduce the problem

PR with tests forthcoming.

RuboCop version

Currently broken on master.

bbatsov added a commit that referenced this issue Jul 28, 2016
Fix #3349: Skip autocorrect for multiline lambda keyword arguments
Neodelf pushed a commit to Neodelf/rubocop that referenced this issue Oct 15, 2016
…ments

Style/Lambda currently skips autocorrection for multiline lambdas
that are arguments to unparenthesized sends. It does not correctly
identify keyword arguments as belonging to this class.
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

No branches or pull requests

1 participant