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 Layout/ClosingParenthesisIndentation #6351

Commits on Dec 17, 2018

  1. Fix a false positive for Layout/ClosingParenthesisIndentation

    This PR fixes a false negative for `Layout/ClosingParenthesisIndentation` when first argument is multiline.
    
    The following is a reproduction step.
    ```bash
    % rubocop -V
    0.59.2 (using Parser 2.5.1.2, running on ruby 2.5.0 x86_64-darwin17)
    
    % cat app/models/users.rb
    class User < ApplicationRecord
      def self.complex_find
        where(
          "users.approved_at < ? OR
           users.approved_at IS NULL", 3.days.ago
        )
      end
    end
    
    % rubocop app/models/users.rb --only Layout/ClosingParenthesisIndentation -d
    or /Users/anton/code/rubocop: configuration from /Users/anton/code/rubocop/.rubocop.yml
    configuration from /Users/anton/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/rubocop-rspec-1.29.1/config/default.yml
    configuration from /Users/anton/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/rubocop-rspec-1.29.1/config/default.yml
    Default configuration from /Users/anton/code/rubocop/config/default.yml
    Inheriting configuration from /Users/anton/code/rubocop/.rubocop_todo.yml
    Inspecting 1 file
    Scanning /Users/anton/code/rubocop/users.rb
    C
    
    Offenses:
    
    users.rb:6:5: C: Layout/ClosingParenthesisIndentation: Indent ) to column 5 (not 4)
        )
        ^
    
    1 file inspected, 1 offense detected
    Finished in 0.5669199999974808 seconds
    ```
    antonzaytsev committed Dec 17, 2018
    Copy the full SHA
    1653112 View commit details
    Browse the repository at this point in the history

Commits on Jan 22, 2019

  1. Copy the full SHA
    603397a View commit details
    Browse the repository at this point in the history