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/MultilineMethodArgumentLineBreaks False Positive On Multiline Assignment #6936

Closed
jfelchner opened this issue Apr 15, 2019 · 1 comment · Fixed by #7072
Closed

Layout/MultilineMethodArgumentLineBreaks False Positive On Multiline Assignment #6936

jfelchner opened this issue Apr 15, 2019 · 1 comment · Fixed by #7072

Comments

@jfelchner
Copy link
Contributor

This is a pretty major bug. The Layout/MultilineMethodArgumentLineBreaks cop is throwing errors when an assignment spans multiple lines. I'm assuming because it sees the assignment operator as a "method" (which it technically is but should not be treated like a method call for the purposes of this cop).

Original PR: #6826

/cc @maxh


Expected behavior

The following code should not throw an error.

class Thing
  def call
    bar['foo'] = ::Time.zone.at(
                   huh['foo'],
                 )
  end
end

Actual behavior

It throws an error.

Steps to reproduce the problem

See code snippet above.

RuboCop version

0.67.2 (using Parser 2.6.2.1, running on ruby 2.6.2 x86_64-darwin17)
@maxh
Copy link
Contributor

maxh commented May 22, 2019

Apologies for delay; didn't get an email for this. Fix: #7072

maxh pushed a commit to maxh/rubocop that referenced this issue May 23, 2019
bbatsov pushed a commit that referenced this issue May 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants