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

[#7842] Fix a false positive for Lint/RaiseException #7845

Merged

Commits on Apr 3, 2020

  1. [rubocop#7842] Fix a false positive for Lint/RaiseException

    Resolve part of rubocop#7842.
    
    This PR fixes a false positive for `Lint/RaiseException`
    when raising Exception with explicit namespace.
    
    `Exception` belonging to a namespace is expected to
    inherit `StandardError`.
    
    This PR makes `Lint/RaiseException` aware of the following differences:
    
    ```ruby
    Gem::Exception.new.is_a?(StandardError) # => true
    Exception.new.is_a?(StandardError)      # => false
    ```
    
    On the other hand, the following case have not been resolved by this PR.
    
    ```ruby
    module Gem
      def self.foo
        raise Exception
      end
    end
    
    Gem.foo #=> Gem::Exception
    ```
    
    The above case will be resolved separately from this PR.
    koic committed Apr 3, 2020
    Configuration menu
    Copy the full SHA
    eda5183 View commit details
    Browse the repository at this point in the history