Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Hixie opened this issue May 3, 2016 · 6 comments · Fixed by Workiva/fluri#52
Assignees
Labels
customer-flutter devexp-linter Issues with the analyzer's support for the linter package legacy-area-analyzer Use area-devexp instead. type-enhancement A request for a change that isn't a bug

Comments

@Hixie
Copy link
Contributor

Hixie commented May 3, 2016

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

@Hixie
Copy link
Contributor Author

Hixie commented May 3, 2016

cc @abarth

@pq
Copy link
Member

pq commented May 4, 2016

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

@keertip ?

@abarth
Copy link
Contributor

abarth commented May 4, 2016

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.

@keertip
Copy link
Contributor

keertip commented May 4, 2016

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

@pq pq added the type-enhancement A request for a change that isn't a bug label May 4, 2016
@pq pq self-assigned this May 4, 2016
@pq
Copy link
Member

pq commented May 4, 2016

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

@Hixie
Copy link
Contributor Author

Hixie commented May 4, 2016

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.

pq referenced this issue in dart-archive/linter May 18, 2016
Introduces:

* Fix to `public_member_api_docs` to check for documented getters when checking setters (#237).
* New `iterable_contains_unrelated_type` lint to detect when `Iterable.contains` is invoked with an object of an unrelated type.
* New `comment_references` lint to ensure identifiers referenced in docs are in scope (#240).

BUG=
[email protected]

Review URL: https://codereview.chromium.org//1992693003 .
pq referenced this issue in pq/flutter May 18, 2016
Notably, this will allow us to play with

* the fixed `public_member_api_docs` that now checks for documented getters when checking setters (https://github.com/dart-lang/linter/issues/237), and
* the new `comment_references` lint that ensures identifiers referenced in docs are in scope (https://github.com/dart-lang/linter/issues/240).
pq referenced this issue in pq/flutter May 18, 2016
Notably, this will allow us to play with

* the fixed `public_member_api_docs` that now checks for documented getters when checking setters (https://github.com/dart-lang/linter/issues/237), and
* the new `comment_references` lint that ensures identifiers referenced in docs are in scope (https://github.com/dart-lang/linter/issues/240).
@devoncarew devoncarew added devexp-linter Issues with the analyzer's support for the linter package legacy-area-analyzer Use area-devexp instead. labels Nov 18, 2024
@devoncarew devoncarew transferred this issue from dart-archive/linter Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
customer-flutter devexp-linter Issues with the analyzer's support for the linter package legacy-area-analyzer Use area-devexp instead. type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants