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
Fix a false positive for Lint/SuppressedException
#11151
Conversation
Can you add a changelog entry?
That template file needs to be edited. e.g.: * [#11151](https://github.com/rubocop/rubocop/pull/11151): Fix a false positive for `Lint/SuppressedException` when empty rescue for `do` block with a numbered parameter. ([@akihikodaki][]). And the file name must start with |
5ddcfd1
to
50b576c
Compare
Added a changelog file. (Though it's a bit questionable policy as you don't get the pull request number until, well, you actually open one.) |
@@ -0,0 +1 @@ | |||
* [#11151](https://github.com/rubocop/rubocop/pull/11151): Fix a false positive for `Lint/SuppressedException`. ([@akihikodaki][https://github.com/akihikodaki]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CI is failing. Can you update it?
* [#11151](https://github.com/rubocop/rubocop/pull/11151): Fix a false positive for `Lint/SuppressedException`. ([@akihikodaki][https://github.com/akihikodaki]) | |
* [#11151](https://github.com/rubocop/rubocop/pull/11151): Fix a false positive for `Lint/SuppressedException` when empty rescue for `do` block with a numbered parameter. ([@akihikodaki][]). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done with commit b9c2d5e.
When there is a rescue with no statement but a comment in a `do` block with a numbered parameter, it incorrectly registered an offense even if AllowComments is set true. Cover the case of `do` block with a numbered parameter to fix the issue.
We know it requires a bit of extra work, but it makes the changelog more useful for the end users (it's easy to lookup changes), which is our primary aim. |
Thanks for fixing this! |
When there is a rescue with no statement but a comment in a
do
block with a numbered parameter, it incorrectly registered an offense even if AllowComments is set true.Cover the case of
do
block with a numbered parameter to fix the issue.[Fix #issue-number]
(if the related issue exists). No related issue found.master
(if not - rebase it).bundle exec rake default
. It executes all tests and runs RuboCop on its own code.{change_type}_{change_description}.md
if the new code introduces user-observable changes. See changelog entry format for details.Well, running
bundle exec rake changelog:fix
will give a template containing[#x](https://github.com/rubocop/rubocop/pull/x)
but I don't think that's what you want...