You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Auto-correcting Style/RedundantBegin with RuboCop v0.93 breaks code if the value of subject begin-end block is used as a method call parameter or as rhs of a binop.
No offense if value of subject begin-end block is rhs of an assignment, e.g. @var ||= begin ...
Fixesrubocop#8871.
This PR fixes a false positive for `Style/RedundantBegin`
when using `begin` for method argument or part of conditions.
`begin` keyword may be redundant when using only one expression
in `begin` of each issue case.
However, since it is the unintended case for rubocop#8822, I think it
can be implemented as an enhancement different from this bug fix.
Fixes#8871.
This PR fixes a false positive for `Style/RedundantBegin`
when using `begin` for method argument or part of conditions.
`begin` keyword may be redundant when using only one expression
in `begin` of each issue case.
However, since it is the unintended case for #8822, I think it
can be implemented as an enhancement different from this bug fix.
Auto-correcting
Style/RedundantBegin
with RuboCop v0.93 breaks code if the value of subject begin-end block is used as a method call parameter or as rhs of a binop.No offense if value of subject begin-end block is rhs of an assignment, e.g.
@var ||= begin ...
Expected behavior
These code should not offense nor auto-correct.
Actual behavior
Auto-correction breaks code.
Steps to reproduce the problem
RuboCop version
The text was updated successfully, but these errors were encountered: