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

Autocorrect of Style/InverseMethods breaks double negatives #4393

Closed
capripot opened this issue May 19, 2017 · 1 comment · Fixed by #4409
Closed

Autocorrect of Style/InverseMethods breaks double negatives #4393

capripot opened this issue May 19, 2017 · 1 comment · Fixed by #4409
Labels

Comments

@capripot
Copy link

Autocorrect of Style/InverseMethods breaks double negatives for at least regexp checks as following.


Given code

!!(string =~ /^\w+$/)

Expected behavior

!!(string =~ /^\w+$/)

Actual behavior

!string !~ /^\w+$/

Steps to reproduce the problem

rubocop -a on files containing the given code

RuboCop version

$ rubocop -V
0.48.1 (using Parser 2.4.0.0, running on ruby 2.2.7 x86_64-darwin16)
@bbatsov bbatsov added the bug label May 21, 2017
@rrosenblum
Copy link
Contributor

It seems like it should be easy enough to ignore double negation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants