lib/inch/evaluation/method_object.rb in inch-0.1.0 vs lib/inch/evaluation/method_object.rb in inch-0.1.1

- old
+ new

@@ -20,10 +20,13 @@ add_role Role::Method::WithManyLines.new(object) end if object.bang_name? add_role Role::Method::WithBangName.new(object) end + if object.questioning_name? + add_role Role::Method::WithQuestioningName.new(object) + end if object.has_alias? add_role Role::Method::HasAlias.new(object) end if object.nodoc? add_role Role::Object::TaggedAsNodoc.new(object) @@ -115,10 +118,18 @@ end end def eval_return_type if object.return_mentioned? - add_role Role::Method::WithReturnType.new(object, RETURN_SCORE) + if object.questioning_name? && !object.return_described? + # annotating a question mark method with the return type boolean + # does not give any points + # also, this could to be one of those cases where YARD + # automatically assigns a @return tag to methods ending in a + # question mark + else + add_role Role::Method::WithReturnType.new(object, RETURN_SCORE) + end else add_role Role::Method::WithoutReturnType.new(object, RETURN_SCORE) end end end