Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix a false positive for
Lint/SuppressedException
This PR fixes a false positive for `Lint/SuppressedException` when empty rescue with comment in `def`. ```console % cat example.rb def foo do_something rescue # noop end % bundle exec rubocop --only Lint/SuppressedException (snip) Inspecting 1 file W Offenses: example.rb:3:1: W: Lint/SuppressedException: Do not suppress exceptions. rescue ^^^^^^ 1 file inspected, 1 offense detected ``` The above code should not be warned because `AllowComments: true` by defualt.
- Loading branch information
Showing
3 changed files
with
45 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters