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

Disable Style/ZeroLengthPredicate cop #11

Merged
merged 1 commit into from
Jan 16, 2017

Conversation

onk
Copy link
Owner

@onk onk commented Jan 13, 2017

if size > 0 is used in condition, code will be auto-corrected like this.

if !arr.empty?
  a
else
  b
end

if !cond - else is not readable.

it is one way to remove ! and swap a & b,
but readability depends on which process is the main focus.

if `size > 0` is used in condition, code will be auto-corrected like this.

```ruby
if !arr.empty?
  a
else
  b
end
```

`if !cond - else` is not readable.

it is one way to remove `!` and swap a & b,
but readability depends on which process is the main focus.
@onk onk merged commit 120885b into master Jan 16, 2017
@onk onk deleted the feature/disable_zero_length_predicate branch January 16, 2017 03:22
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

Successfully merging this pull request may close these issues.

1 participant