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
Style/RaiseArgs cop only reports the first instance encountered #8759
Comments
I am getting similar behavior running the |
Can't reproduce. |
Yes, we have
where I would have expected 4 offences and |
I isolated the problem down to one file and edited the steps to reproduce in the initial comment. |
Other examples where this fails, including @KaraAJC's finding:
Also related to #8799 and #8801. I don't know what the intent is with disabling an enforced style mid-run, but any cop that uses |
[Fix #8759] Fix multiple offense detection for Style/RaiseArgs
As the title suggests,
Style/RaiseArgs
only reports one instance at a time. I'm not clear on the context ofcompact
vsexploded
, nor the idea behindopposite_style_detected
, but commenting out line 106 (return unless opposite_style_detected
) of the cop seems to take care of business. This line was introduced after 0.89.0 and the cop works fine before that.Expected behavior
Multiple instances of raising an error that instantiates an error class with a message all report the
Style/RaiseArgs
cop.Actual behavior
(Edited)
Only the instances that Rubocop encounters before subsequently encountering the allowed form of raising errors are reported. All other instances are ignored.
Steps to reproduce the problem
(Edited)
RuboCop version
0.91.0
The text was updated successfully, but these errors were encountered: