Skip to content
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 #8017

Merged

Commits on May 24, 2020

  1. 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.
    koic committed May 24, 2020
    Copy the full SHA
    b5d9ae1 View commit details
    Browse the repository at this point in the history