-
-
Notifications
You must be signed in to change notification settings - Fork 263
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
Rails/TransactionExitStatement false positive? #669
Labels
bug
Something isn't working
Comments
koic
added a commit
to koic/rubocop-rails
that referenced
this issue
Mar 17, 2022
…ement` Fixes rubocop#669. This PR fixes a false positive for `Rails/TransactionExitStatement` when `return` is used in `rescue`.
10 tasks
koic
added a commit
that referenced
this issue
Mar 17, 2022
…ction_exit_statement [Fix #669] Fix a false positive for `Rails/TransactionExitStatement`
thanks! |
koic
added a commit
to koic/rubocop-rails
that referenced
this issue
Apr 23, 2022
Follow up rubocop#674 (comment) Revert "[Fix rubocop#669] Fix a false positive for `Rails/TransactionExitStatement`" This reverts commit d9ec02d. So this PR fixes a false negative for `Rails/TransactionExitStatement` when `return` is used in `rescue`.
10 tasks
JFYI, this behavior is not a false positive and will be changed by #696. Please see below for the reason: |
koic
added a commit
to koic/rubocop-rails
that referenced
this issue
Apr 23, 2022
Follow up rubocop#674 (comment) Revert "[Fix rubocop#669] Fix a false positive for `Rails/TransactionExitStatement`" This reverts commit d9ec02d and tweak a spec. So this PR fixes a false negative for `Rails/TransactionExitStatement` when `return` is used in `rescue`.
koic
added a commit
to koic/rubocop-rails
that referenced
this issue
Apr 27, 2022
Follow up rubocop#674 (comment) Revert "[Fix rubocop#669] Fix a false positive for `Rails/TransactionExitStatement`" This reverts commit d9ec02d and add an example, tweak a spec. So this PR fixes a false negative for `Rails/TransactionExitStatement` when `return` is used in `rescue`.
koic
added a commit
to koic/rubocop-rails
that referenced
this issue
Apr 27, 2022
Follow up rubocop#674 (comment) Revert "[Fix rubocop#669] Fix a false positive for `Rails/TransactionExitStatement`" This reverts commit d9ec02d and add an example, tweak a spec. So this PR fixes a false negative for `Rails/TransactionExitStatement` when `return` is used in `rescue`.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Rails/TransactionExitStatement
is catching this code but i don't think it's correct:i believe in this case
return
is being called outside of the transaction and therefore isn't exiting the transaction (at this point the txn already exited by raising an error).Expected behavior
this code should be ignored.
Actual behavior
this code is flagged.
Steps to reproduce the problem
see above code.
RuboCop version
The text was updated successfully, but these errors were encountered: