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

[Fix #4179] Prevent Rails/Blank cop from breaking when LHS of is a naked falsiness check #4190

Merged
merged 1 commit into from Mar 28, 2017

Conversation

rrosenblum
Copy link
Contributor

@rrosenblum rrosenblum commented Mar 27, 2017

This fixes #4179. This is a similar fix to what was done to fix #4171. This issue does not seem to impact Rails/Present.

@Drenmi
Copy link
Collaborator

Drenmi commented Mar 28, 2017

Kind of an awkward miss by me. I assumed too hastily that the problem was the "not-not" check of the RHS. 😅

@rrosenblum
Copy link
Contributor Author

Kind of awkward miss by me as well. I feel like it is such a simple example. I feel like I have been testing less edge cases since I started using NodePattern more. I think this is because NodePattern typically creates a more resilient check. I guess I will have to beef up my testing.

@Drenmi
Copy link
Collaborator

Drenmi commented Mar 28, 2017

I feel like I have been testing less edge cases since I started using NodePattern more. I think this is because NodePattern typically creates a more resilient check.

Same. I think NodePattern is amazing for that reason. It's very hard to work with an AST that has so many permutations without it. I agree that we can't rely on it over tests, though. 🙂

Another thing I like about RuboCop is the testing strategy. "This literal code should (or should not) generate an offense" is super easy to understand and, I must admit, RuboCop is the only project for which I always write the tests first. 😶

@bbatsov bbatsov merged commit 246bef5 into rubocop:master Mar 28, 2017
@bbatsov
Copy link
Collaborator

bbatsov commented Mar 28, 2017

👍

@esambo
Copy link

esambo commented Mar 30, 2017

Would be nice to release a new rubocop version with this, as 0.48.0 is broken because of this

@joevandyk
Copy link

bump on new rubocop version :)

@bbatsov
Copy link
Collaborator

bbatsov commented Mar 31, 2017 via email

YutaGoto added a commit to YutaGoto/rubocop that referenced this pull request Nov 7, 2017
YutaGoto added a commit to YutaGoto/rubocop that referenced this pull request Nov 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants