-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Autocorrect ParenthesesAroundCondition. #614
Autocorrect ParenthesesAroundCondition. #614
Conversation
@@ -22,6 +22,21 @@ | |||
'x += 1 until (x < 10)', | |||
]) | |||
expect(cop.offences.size).to eq(9) | |||
expect(corrected).to eq ['if x > 10', |
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.
As I mentioned in #612 we prefer to have the auto-correct examples separated from the detection examples.
Coverage decreased (-0.09%) when pulling 82aef39655aeddc1becc69400f876d5159e6212e on dblock:autocorrect-parenthesis-around-condition into e4c8a22 on bbatsov:master. |
Coverage decreased (-0.09%) when pulling 82aef39655aeddc1becc69400f876d5159e6212e on dblock:autocorrect-parenthesis-around-condition into e4c8a22 on bbatsov:master. |
This has been updated, test for autocorrection split. |
Coverage decreased (-0.09%) when pulling 7acb3b9259c4f2b51514bb41eaca3aa61982c307 on dblock:autocorrect-parenthesis-around-condition into e4c8a22 on bbatsov:master. |
@@ -41,7 +72,7 @@ | |||
expect(cop.offences).to be_empty | |||
end | |||
|
|||
it 'is not confused by leading brace in subexpression' do | |||
it 'is not confused by leading parentheses in subexpression' do |
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.
parentheses -> parenthesis (it's not plural here)
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.
Whooops, fixed. English is my 3rd language :)
Coverage decreased (-0.09%) when pulling 3e50f0e8c615d18b9f6c470af2f75db79a92b681 on dblock:autocorrect-parenthesis-around-condition into e4c8a22 on bbatsov:master. |
Coverage decreased (-0.09%) when pulling 3e50f0e8c615d18b9f6c470af2f75db79a92b681 on dblock:autocorrect-parenthesis-around-condition into e4c8a22 on bbatsov:master. |
@@ -2,6 +2,8 @@ | |||
|
|||
## master (unreleased) | |||
|
|||
* [#614](https://github.com/bbatsov/rubocop/pull/614): `ParenthesesAroundCondition` cop does auto-correction. ([@dblock][]) |
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.
You'll have to rebase because of a conflicting change here in your other PR that I just merged. Btw, add a heading "New features".
Rebased, good to merge. |
…ndition Autocorrect ParenthesesAroundCondition.
No description provided.