lib/inch/language/elixir/roles/function_parameter.rb in inch-0.5.0.rc11 vs lib/inch/language/elixir/roles/function_parameter.rb in inch-0.5.0
- old
+ new
@@ -9,17 +9,22 @@
module FunctionParameter
# Role assigned to parameters that are mentioned in the docs
#
# @see CodeObject::Ruby::MethodParameterObject#mentioned?
class WithMention < Base
- applicable_if :mentioned?
+ applicable_if do |p|
+ # unnamed parameters are mentioned implicitly
+ p.mentioned? || p.unnamed?
+ end
end
# Role assigned to parameters that are not mentioned in the docs
#
# @see CodeObject::Ruby::MethodParameterObject#mentioned?
class WithoutMention < Missing
- applicable_unless :mentioned?
+ applicable_if do |p|
+ !p.mentioned? && !p.unnamed?
+ end
def suggestion
"Describe the parameter '#{object.name}'"
end
end