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

Rubocop identifies wrongly an scoped version of Exception #11893

Closed
vpereira opened this issue May 26, 2023 · 0 comments · Fixed by #11896
Closed

Rubocop identifies wrongly an scoped version of Exception #11893

vpereira opened this issue May 26, 2023 · 0 comments · Fixed by #11896
Labels

Comments

@vpereira
Copy link

Looks like the rule https://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Lint/InheritException, doesn't take into account if the Exception class is scoped or not.

i.e

module DockerRegistry2
  class Exception < RuntimeError
  end

  class RegistryAuthenticationException < DockerRegistry2::Exception
  end
  # ...
end

Rubocop is however mixing this scoped DockerRegistry2::Exception class with ::Exceptions.

More details you can find in the following PR: deitch/docker_registry2#81

@koic koic added the bug label May 27, 2023
koic added a commit to koic/rubocop that referenced this issue May 27, 2023
Fixes rubocop#11893.

This PR fixes a false positive for `Lint/InheritException`
when inheriting `Exception` with omitted namespace.
koic added a commit that referenced this issue May 28, 2023
…it_exception

[Fix #11893] Fix a false positive for `Lint/InheritException`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants