-
Notifications
You must be signed in to change notification settings - Fork 0
Description
In Crystal, it's a common convention that method names ending in a ? do not raise, but return nil if the task can not be completed. Other use case for ? is methods that return Bool. E.g. Hash#empty? returns a Bool, indicating whether the Hash has any members. Other use case is String#to_i32 raises if the string don't contain a valid number, but String#to_i32? returns nil if the string is not a valid number. A method with a name ending in ? can confuse programmers if it raises.
E.g. CommentPolicy#show? follows the convention as it returns Bool, and doesn't raise, but CommentPolicy#show_not_found? breaks from the convention as it raises.
Please provide an alias without ? for every method that raises (with the ? version retained for backwards compatibility).