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 Lint/ParenthesesAsGroupedExpression
#7909
Merged
koic
merged 1 commit into
rubocop:master
from
koic:fix_a_false_positive_for_parentheses_as_grouped_expression
May 9, 2020
Merged
Fix a false positive for Lint/ParenthesesAsGroupedExpression
#7909
koic
merged 1 commit into
rubocop:master
from
koic:fix_a_false_positive_for_parentheses_as_grouped_expression
May 9, 2020
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
koic
force-pushed
the
fix_a_false_positive_for_parentheses_as_grouped_expression
branch
from
April 26, 2020 11:39
397c1ce
to
4a8b5e5
Compare
8 tasks
koic
added a commit
to koic/ruby-style-guide
that referenced
this pull request
Apr 26, 2020
Follow up of rubocop/rubocop#7909. This PR refines an example for "Space in Method Calls" rule. The example code is not compatible. ```ruby def f(num) num * 2 end p f (3 + 2) + 1 #=> 12 p f(3 + 2) + 1 #=> 11 ``` This PR replaces an example code.
koic
force-pushed
the
fix_a_false_positive_for_parentheses_as_grouped_expression
branch
from
April 27, 2020 02:13
4a8b5e5
to
47297ff
Compare
The fix looks good, but we should probably tweak the examples in the docs, as they look a lot like math expressions. :-) |
koic
force-pushed
the
fix_a_false_positive_for_parentheses_as_grouped_expression
branch
2 times, most recently
from
April 29, 2020 07:48
56f76c5
to
5be9497
Compare
I tweaked the existing examples and added a new examples. |
bbatsov
pushed a commit
to rubocop/ruby-style-guide
that referenced
this pull request
Apr 30, 2020
Follow up of rubocop/rubocop#7909. This PR refines an example for "Space in Method Calls" rule. The example code is not compatible. ```ruby def f(num) num * 2 end p f (3 + 2) + 1 #=> 12 p f(3 + 2) + 1 #=> 11 ``` This PR replaces an example code.
koic
force-pushed
the
fix_a_false_positive_for_parentheses_as_grouped_expression
branch
from
May 1, 2020 03:58
5be9497
to
21cb1fd
Compare
This PR fixes a false positive for `Lint/ParenthesesAsGroupedExpression` when using an intended grouped parentheses. ```ruby puts (2 + 3) * 4 ``` I noticed this false positive in implementing this cop's auto-correction. So, I plan to open a PR that implements auto-correction separately from this PR.
koic
force-pushed
the
fix_a_false_positive_for_parentheses_as_grouped_expression
branch
from
May 7, 2020 09:21
21cb1fd
to
5d5cf77
Compare
koic
deleted the
fix_a_false_positive_for_parentheses_as_grouped_expression
branch
May 9, 2020 05:11
koic
added a commit
to koic/rubocop
that referenced
this pull request
May 10, 2020
Follow up to rubocop#7909. This PR supports autocorrection for `Lint/ParenthesesAsGroupedExpression`.
koic
added a commit
to koic/rubocop
that referenced
this pull request
May 13, 2020
…dExpression` Fixes rubocop#7962. This PR fixes the following false positive for `Lint/ParenthesesAsGroupedExpression` when heredoc has a space between the same string as the method name and `(`. ```ruby foo( <<~EOS foo ( ) EOS ) ``` This PR adds a reproduction test and reverts a required logic removed by rubocop#7909.
8 tasks
8 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR fixes a false positive for
Lint/ParenthesesAsGroupedExpression
when using an intended grouped parentheses.I noticed this false positive in implementing this cop's auto-correction. So, I plan to open a PR that implements auto-correction separately from this PR.
Before submitting the PR make sure the following are checked:
[Fix #issue-number]
(if the related issue exists).master
(if not - rebase it).bundle exec rake default
. It executes all tests and RuboCop for itself, and generates the documentation.