Linter: Analyzer shouldn't complain about dartdocs on setters if there's a corresponding getter with a dartdoc

Created on 4 May 2016  路  6Comments  路  Source: dart-lang/linter

It's very useful to be able to put dartdocs on setters specifically, even when the getter has one. However, most of the time, there's really nothing to say. It sets the thing that you can get, which is described in the getter.

It would be nice if we could silence the lint about dartdocs for the case of a setter with an identically named getter that already has a dartdoc.

cc @pq

flutter enhancement

Most helpful comment

For Flutter we'd like, if there's both a getter and a setter but only one has a doc, for the doc to be on the getter, for consistency.

All 6 comments

cc @abarth

Good point. What does dartdoc do in this case? Does it repeat the doc?

@keertip ?

Take a look at the "opacity" property in this dartdoc:

http://docs.flutter.io/flutter/rendering/RenderOpacity-class.html

Here the getter has a docstring but the setter does not.

dartdoc does not explicitly show getters and setters, documents them as properties instead. It looks at both getter and setter for documentation.

Thanks all. I'll update the check to look for docs on one or the other (or both).

For Flutter we'd like, if there's both a getter and a setter but only one has a doc, for the doc to be on the getter, for consistency.

Was this page helpful?
0 / 5 - 0 ratings