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 an incorrect auto-correct for Performance/ReverseEach #201

Merged

Commits on Dec 18, 2020

  1. Fix an incorrect auto-correct for Performance/ReverseEach

    Fixes standardrb/standard#230.
    
    This PR fixes the following incorrect auto-correct for `Performance/ReverseEach`
    when using multi-line `reverse.each` with leading dot.
    
    ```ruby
    % cat example.rb
    [1, 2, 3]
      .reverse
      .each do |idx|
        puts idx
      end
    ```
    
    ## Before
    
    ```console
    % bundle exec rubocop -a --only Performance/ReverseEach
    % cat example.rb
    [1, 2, 3]
      .reverse
      _each do |idx|
        puts idx
      end
    ```
    
    ## After
    
    ```console
    % bundle exec rubocop -a --only Performance/ReverseEach
    % cat example.rb
    [1, 2, 3]
      .reverse_each do |idx|
        puts idx
      end
    ```
    koic committed Dec 18, 2020
    Configuration menu
    Copy the full SHA
    2ae0e2e View commit details
    Browse the repository at this point in the history