Merge: modelize: `missing-doc` on attributes
authorJean Privat <jean@pryen.org>
Wed, 1 Oct 2014 21:17:06 +0000 (17:17 -0400)
committerJean Privat <jean@pryen.org>
Wed, 1 Oct 2014 21:17:06 +0000 (17:17 -0400)
missing-doc only fires on public properties.
But attributes are always Private, so consider the getter method instead.

It make sense since the documentation on an attribute documents more the
getter than the attribute.

Pull-Request: #800
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>

src/modelize/modelize_property.nit

index 28e6a03..941d4ee 100644 (file)
@@ -775,7 +775,6 @@ redef class AAttrPropdef
                var mpropdef = new MAttributeDef(mclassdef, mprop, self.location)
                self.mpropdef = mpropdef
                modelbuilder.mpropdef2npropdef[mpropdef] = self
-               set_doc(mpropdef, modelbuilder)
 
                var readname = name
                var mreadprop = modelbuilder.try_get_mproperty_by_name(nid2, mclassdef, readname).as(nullable MMethod)
@@ -793,7 +792,8 @@ redef class AAttrPropdef
                var mreadpropdef = new MMethodDef(mclassdef, mreadprop, self.location)
                self.mreadpropdef = mreadpropdef
                modelbuilder.mpropdef2npropdef[mreadpropdef] = self
-               mreadpropdef.mdoc = mpropdef.mdoc
+               set_doc(mreadpropdef, modelbuilder)
+               mpropdef.mdoc = mreadpropdef.mdoc
 
                var atlazy = self.get_single_annotation("lazy", modelbuilder)
                if atlazy != null then