Warning in yard with @param tag
Asked Answered
H

1

6

I was trying to document some Ruby code using yardand even though I am doing exactly what is described here or here

# @param [Integer] the number of trials (>= 0)
# @param [Float] success probability in each trial
def initialize(n, p)
  # initialize...
end 

I still get this strange error though

@param tag has unknown parameter name: the
@param tag has unknown parameter name: success

and then the generated html looks wierd. I am calling yard this:

$ yard doc -m markdown

What could I be doing wrong?

Hydroquinone answered 3/7, 2012 at 13:27 Comment(0)
T
10

doc says @param tag has format

@param [Type] name description

and your lines do not include param names (n and p respectively)

Tiger answered 3/7, 2012 at 13:34 Comment(4)
Thanks a lot! I hadn't noticed it. it's not very clear from looking at the examples at the getting started documentHydroquinone
indeed it's very easy to miss that param name is required in there. glad i could help you, cheers!Tiger
As of Yard 0.8.7.3, the syntax is @param name [Types] description.Shirtmaker
@Shirtmaker Yes, but the old one still seems to work.Chit

© 2022 - 2024 — McMap. All rights reserved.