KEMBAR78
Enhance `Lint::ConstantOverwrittenInRescue` to detect offenses within fully qualified constants by viralpraxis · Pull Request #14566 · rubocop/rubocop · GitHub
Skip to content

Conversation

@viralpraxis
Copy link
Contributor

Prior to theses changes, this would not be detected:

begin
rescue => ::MyException
end

Before submitting the PR make sure the following are checked:

  • The PR relates to only one subject with a clear title and description in grammatically correct, complete sentences.
  • Wrote good commit messages.
  • Feature branch is up-to-date with master (if not - rebase it).
  • Squashed related commits together.
  • Added tests.
  • Ran bundle exec rake default. It executes all tests and runs RuboCop on its own code.
  • Added an entry (file) to the changelog folder named {change_type}_{change_description}.md if the new code introduces user-observable changes. See changelog entry format for details.

… fully qualified constants

Prior to theses changes, this would not be detected:

```ruby
begin
rescue => ::MyException
end
```
@koic koic merged commit 6c95972 into rubocop:master Sep 26, 2025
22 checks passed
@viralpraxis viralpraxis deleted the enhance-constant-overwritten-in-rescue-to-detect-fully-qualified-constant-name branch September 29, 2025 09:36
viralpraxis added a commit to viralpraxis/rubocop that referenced this pull request Oct 1, 2025
viralpraxis added a commit to viralpraxis/rubocop that referenced this pull request Oct 1, 2025
viralpraxis added a commit to viralpraxis/rubocop that referenced this pull request Oct 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants