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

Style/ZeroLengthPredicate, accepts length < 1 #2905

Closed
dennisvandehoef opened this issue Mar 3, 2016 · 1 comment
Closed

Style/ZeroLengthPredicate, accepts length < 1 #2905

dennisvandehoef opened this issue Mar 3, 2016 · 1 comment

Comments

@dennisvandehoef
Copy link

The cop Style/ZeroLengthPredicate allows "bad" length checks.
length == 0 gets reported and should be replaced with empty? but length < 1 is ok.
since length < 1 also is an empty? question, it should report it.

Expected behavior

as it does for length == 0, report it

RuboCop version

0.37.2 (using Parser 2.3.0.6, running on ruby 2.1.7 x86_64-darwin14.0)

@alexdowad
Copy link
Contributor

Thanks for the suggestion. Just added a fix to my open PR.

@bbatsov bbatsov closed this as completed in f753a44 Mar 5, 2016
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

2 participants