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

Make Style/ZeroLengthPredicate aware of array.length.zero? #11327

Merged

Commits on Dec 24, 2022

  1. Make Style/ZeroLengthPredicate aware of array.length.zero?

    Closes rubocop#11314.
    
    Follow rubocop#11314 (comment).
    
    This PR makes `Style/ZeroLengthPredicate` aware of `array.length.zero?`.
    
    I'm not sure if `array.any?` is better than `array.length.positive`
    as answered in rubocop#11314.
    
    But `array.length == 0` and `array.length.zero?` are equivalent,
    it should be possible to convert to `array.emtpy?` in the same way.
    koic committed Dec 24, 2022
    Configuration menu
    Copy the full SHA
    6971d11 View commit details
    Browse the repository at this point in the history