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
Fix a false positive for Layout/ClosingParenthesisIndentation
#6351
Conversation
ac7771b
to
74d9678
Compare
054c5d5
to
4b75173
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this fixing a false positive?
@rrosenblum good questions actually. Do you have example handy? |
4b75173
to
b5031e3
Compare
I don't have a specific example. In general, I tend to think of a false positive as code that generates an offense when it should not. A false negative is when code doesn't produce an offense, but it should. |
Layout/ClosingParenthesisIndentation
Layout/ClosingParenthesisIndentation
b5031e3
to
403d12e
Compare
@rrosenblum you're right, it is a fix for false positive. Thanks! |
403d12e
to
9b7b95a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
⛵️
I've also run into an issue where the following code did not report an offense in 0.55 but does now. I'm not sure if this will fix it, but seems likely? foo = foo.bar(<<-SQL
CODE HERE
SQL
) |
The changes look good, but your branch has to be rebased on top of the current |
5f52d97
to
c22e191
Compare
@bbatsov rebased, conflict solved. |
The conflict was fixed in October but since nothing happened afterward, there’s another conflict. |
c22e191
to
0881efa
Compare
0881efa
to
3daec72
Compare
@antonzaytsev @cgriego Since we have some releases since then the entry also has to be moved where it belongs. I'm sorry for the slow turn-around, but I can't always keep up with everything here. In such cases (when it's clear that a PR is a goon shape and it has been vetted by Core Team members) it'd be best if the other @rubocop-hq/rubocop-core members merge the PRs after they've been approved, to avoid the constant rebases and merge delays caused by my lack of bandwidth. |
3daec72
to
8ff6db2
Compare
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 ```
8ff6db2
to
1653112
Compare
Thank you, @antonzaytsev! 🙇 |
This PR fixes a false negative for
Layout/ClosingParenthesisIndentation
when first argument is multiline.The following is a reproduction step.
Before submitting the PR make sure the following are checked:
[Fix #issue-number]
(if the related issue exists).master
(if not - rebase it).and description in grammatically correct, complete sentences.
rake default
. It executes all tests and RuboCop for itself, and generates the documentation.