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 false positives for Rails/CompactBlank #1313

Merged

Commits on Jul 13, 2024

  1. Fix false positives for Rails/CompactBlank

    This PR fixes false positives for `Rails/CompactBlank`
    when using `collection.reject!`.
    
    `reject!(&:blank?)` is not equivalent to `compact_blank!`:
    
    ```ruby
    {}.reject!(&:blank?)            # => nil
    {}.reject! { |_k, v| v.blank? } # => nil
    {}.compact_blank!               # => {}
    ```
    
    This PR prioritizes safer behavior with plain hashes and arrays.
    koic committed Jul 13, 2024
    Configuration menu
    Copy the full SHA
    78d3eee View commit details
    Browse the repository at this point in the history