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
Metrics/ClassLength cop failing on multi-variable assignment after 0.90.0 #8880
Comments
Are you intentionally assigning 3 constants to the same array of arrays? I agree that this should parse, but it also seems like you meant to write: X, Y, Z = [["x", "X"], ["y", "Y"], ["z", "Z"]].freeze Example: A = "blah".freeze
A
=> "blah"
X = Y = Z = [["x", "X"], ["y", "Y"], ["z", "Z"]].freeze
X
=> [["x", "X"], ["y", "Y"], ["z", "Z"]]
Y
=> [["x", "X"], ["y", "Y"], ["z", "Z"]]
Z
=> [["x", "X"], ["y", "Y"], ["z", "Z"]] I guess I'm also trying to confirm that your code example is accurate to the real-world problem. |
Fixes rubocop#8880. This PR fixes an error for `Style/ClassLength` when overlapping constant assignments.
Yes, it's intentional. I probably should have used a different example. I apologize. Thanks for following up. This should cause it to fail as well:
vs this and the cop can process:
|
I have the same problem. Thanks for fixing! |
Fixes #8880. This PR fixes an error for `Style/ClassLength` when overlapping constant assignments.
Expected behavior
Metrics/ClassLength cop should be able to examine the file
Actual behavior
Steps to reproduce the problem
The line of code it was failing on was similar to this:
I was upgrading from
0.90.0
to0.93.0
when I found the issue.RuboCop version
The text was updated successfully, but these errors were encountered: