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

Invalid auto-correct on negated if with parentheses #1066

Closed
ebastien opened this issue May 6, 2014 · 2 comments
Closed

Invalid auto-correct on negated if with parentheses #1066

ebastien opened this issue May 6, 2014 · 2 comments
Assignees

Comments

@ebastien
Copy link

ebastien commented May 6, 2014

The code "0 if (!a)" is corrected to "0 if a":

if.rb:1:1: C: [Corrected] Favor if over unless for negative conditions.
0 unless !a
^^^^^^^^^^^
if.rb:1:1: C: [Corrected] Favor unless over if for negative conditions.
0 if (!a)
^^^^^^^^^
if.rb:1:6: C: [Corrected] Don't use parentheses around the condition of an if.
0 if (!a)
     ^^^^

I am running RuboCop 0.21.0

@bbatsov
Copy link
Collaborator

bbatsov commented May 6, 2014

@jonas054 Would you have a look at this?

@jonas054 jonas054 self-assigned this May 6, 2014
@jonas054
Copy link
Collaborator

jonas054 commented May 6, 2014

Yes.

bbatsov added a commit that referenced this issue May 7, 2014
[Fix #1066] Fix auto-correct of parenthesized condition in NegatedIf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants