-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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/RaiseArgs doesn't handle exception classes with just keyword arguments properly #3944
Comments
I confirmed the reported behavior on master with the default configuration. Additionally, This seems like an inconsistency that should be allowed. |
11 tasks
mikegee
added a commit
to mikegee/rubocop
that referenced
this issue
Jan 22, 2017
bbatsov
pushed a commit
that referenced
this issue
Jan 22, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Expected behavior
When using an exception class with just keyword arguments, it should not find an offense.
Actual behavior
It finds an offense, telling me I should be using
raise MyError, message
instead. This is because the code simply checks if there's only 1 argument, and keyword argument always count as one.Steps to reproduce the problem
Run rubocop on the following snippet, with Style/RaiseArgs enabled
RuboCop version
Include the output of
rubocop -V
. Here's an example:The text was updated successfully, but these errors were encountered: