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 Performance/MapCompact autocorrect causing invalid syntax #291

Commits on Jun 3, 2022

  1. Fix Performance/MapCompact autocorrect causing invalid syntax

    This commit fixes the issue when `Performance/MapCompact` auto-correction
    fails to detect the argument block of an assignment method so it deletes
    the block ending (i.e. `end` or `}`) when `map { ... }.compact` is
    multiline.
    
    Before
    
    ```ruby
    object.new_collection = collection.map do |item|
    end.compact
    
    object.new_collection = collection.filter_map do |item|
    ```
    
    After
    
    ```ruby
    object.new_collection = collection.map do |item|
    end.compact
    
    object.new_collection = collection.filter_map do |item|
    end
    ```
    QQism committed Jun 3, 2022
    Configuration menu
    Copy the full SHA
    2ac0334 View commit details
    Browse the repository at this point in the history