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

[Fix #10622] Fix a false positive for Style/RaiseArgs #10623

Merged

Commits on May 11, 2022

  1. [Fix rubocop#10622] Fix a false positive for Style/RaiseArgs

    Fixes rubocop#10622.
    
    This PR fixes a false positive for `Style/RaiseArgs` when
    error type class constructor with keyword arguments and message argument.
    
    The signature of `raise` is below.
    
    ```ruby
    raise
    raise(string, cause: $!)
    raise(exception [, string [, array]], cause: $!)
    ```
    
    https://ruby-doc.org/core-3.1.0/Kernel.html#method-i-raise
    
    So rubocop#10622 would be a false positive because `raise MyError.new(data: 'mydata'), 'message'` and
    `raise MyError.new('message', data: 'mydata')` are incompatible.
    koic committed May 11, 2022
    Configuration menu
    Copy the full SHA
    83cd538 View commit details
    Browse the repository at this point in the history