-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Cop for raise arguments doesn't account for a splat operator #3577
Comments
Yes. I think we should contend ourselves with not reporting when the splat operator is used, like in |
savef
added a commit
to savef/rubocop
that referenced
this issue
Oct 7, 2016
…tted args With the default style (exploded) one is typically allowed to use the compact style if passing multiple args into the constructor. However an offence was being generated if those args were splatted in, this changes that so there is no offence. Also refactored the cop to use guard clauses to reduce nesting.
Neodelf
pushed a commit
to Neodelf/rubocop
that referenced
this issue
Oct 15, 2016
…tted args With the default style (exploded) one is typically allowed to use the compact style if passing multiple args into the constructor. However an offence was being generated if those args were splatted in, this changes that so there is no offence. Also refactored the cop to use guard clauses to reduce nesting.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Related to #552.
The following example causes an offense:
The offense here being "Provide an exception class and message as arguments to raise."
I think the example is relatively self explanatory in what it's trying to achieve, but let me know if there's any questions.
Expected behavior
Rubocop should either not have a problem with use of the splat operator in this case, or detect if the array has more than one argument before raising the offense.
RuboCop version
The text was updated successfully, but these errors were encountered: