Skip to content

RUBY-3982 Enable Lint/UnreachableCode cop - #3114

Merged
jamis merged 2 commits into
mongodb:masterfrom
jamis:3982-unreachable-code
Oct 21, 2026
Merged

jamis merged 2 commits into
mongodb:masterfrom
jamis:3982-unreachable-code

Conversation

@jamis

@jamis jamis commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

Cleans up Lint/UnreachableCode by removing the cop's exclusion from .rubocop_todo.yml and fixing the two offenses it reported.

In Sections::PayloadOne.deserialize the method is an intentional NotImplementedError stub, so I deleted the abandoned implementation below the raise (its size arithmetic was wrong anyway) and widened the signature to match its two-argument call site.

In the unified test runner's isTimeoutError branch, a stray raise made the intended Error::ErrorMismatch unreachable; I removed it so the mismatch is reported as intended.

Remove the cop's exclusion from .rubocop_todo.yml and fix the two
offenses it reported.

Sections::PayloadOne.deserialize is a deliberate NotImplementedError
stub; delete the abandoned implementation below the raise and widen
the signature to match its call site.

In the unified test runner, drop a stray raise that made the intended
Error::ErrorMismatch raise unreachable in the isTimeoutError branch.
@jamis
jamis requested a review from a team as a code owner October 14, 2026 19:30
@jamis
jamis requested review from JamesKovacs and comandeo-mongo and removed request for JamesKovacs October 14, 2026 19:30
comandeo-mongo
comandeo-mongo previously approved these changes Oct 19, 2026
@jamis
jamis merged commit d7d9d04 into mongodb:master Oct 21, 2026
244 of 245 checks passed
@jamis
jamis deleted the 3982-unreachable-code branch October 21, 2026 19:39
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