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 #7842] Add AcceptImplicitNamespaces to Lint/RaiseException #7846

Commits on Apr 4, 2020

  1. [Fix rubocop#7842] Add AcceptImplicitNamespaces to `Lint/RaiseExcep…

    …tion`
    
    Fixes rubocop#7842.
    
    This PR adds `AcceptImplicitNamespaces` option to `Lint/RaiseException`.
    
    Users can specify and accept an implicit namespace as follows:
    
    ```yaml
    Lint/RaiseException:
      AllowImplicitNamespaces:
        - 'Gem'
    ```
    
    ```ruby
    # good
    module Gem
      def self.foo
        raise Exception
      end
    end
    
    Gem.foo #=> Gem::Exception
    ```
    
    `Gem` is specified by default.
    https://ruby-doc.org/stdlib-2.7.0/libdoc/rubygems/rdoc/Gem/Exception.html
    
    This way does not prevent all false positives, but it expect some cases
    can be solved.
    koic committed Apr 4, 2020
    Configuration menu
    Copy the full SHA
    59e0823 View commit details
    Browse the repository at this point in the history