Skip to content

make @visibleForTesting equivalent to dartdoc's @nodoc tag #1664

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

Open
jcollins-g opened this issue Apr 11, 2018 · 7 comments
Open

make @visibleForTesting equivalent to dartdoc's @nodoc tag #1664

jcollins-g opened this issue Apr 11, 2018 · 7 comments
Labels
customer-flutter Issues originating from important to Flutter P2 A bug or feature request we're likely to work on type-enhancement A request for a change that isn't a bug

Comments

@jcollins-g
Copy link
Contributor

jcollins-g commented Apr 11, 2018

@jacob314 suggested that @visibleForTesting could be made equivalent to the @nodoc tag and hide elements so tagged.

P3 because I'm not sure dartdoc is the right place to implement this, but I think the idea in general to align these is reasonable. It's a little tricky because dartdoc has to locate the special object in question (making me think of #1554) but if we decide it is a good idea it's definitely possible.

@jcollins-g jcollins-g added type-enhancement A request for a change that isn't a bug P3 A lower priority bug or feature request customer-flutter Issues originating from important to Flutter labels Apr 11, 2018
@chalin
Copy link
Contributor

chalin commented Apr 18, 2018

Maybe support defining aliases for @nodoc (rather than hardcode specific names), in the (newly introduced) dartdoc YAML config? /cc @kwalrath

@jcollins-g
Copy link
Contributor Author

@chalin Yes, specifying annotations that should be treated as nodoc in dartdoc_options.yaml should work. Though if we really do want to allow specifying arbitrary ones we should fix #1554 first.

@BrennanGambling
Copy link

@jcollins-g If not this this would just adding an option to ignore @Nodoc tag to the command line tool work?

@jcollins-g
Copy link
Contributor Author

@BrennanGambling Hi Brennan, I'm not sure I understand what "adding an option to ignore @Nodoc tag to the command line tool work" means here. Dartdoc already ignores @nodoc.

If you mean, add these via the command line, part of the problem from dartdoc's perspective is finding a way to specify which named object to hide. Users can create their own classes with the same name and without some special support (like that added in the fix to #1554) it's not easy to add support for arbitrary ones.

Increasing to P2 -- it seems like a good idea to do something about this even if we're not sure what yet.

@jcollins-g jcollins-g added P2 A bug or feature request we're likely to work on and removed P3 A lower priority bug or feature request labels Feb 11, 2019
@BrennanGambling
Copy link

@jcollins-g by "adding an option to ignore the @Nodoc tag" I mean a command line option/flag the will ignore the @Nodoc tag and not the comment. So in the default mode adding the @Nodoc tag to a comment would mean it would not appear in the documentation. but say calling dartdoc with a --ignore-nodoc-tag option would mean doc comments tagged with @Nodoc would still appear in the documentation. It would be very useful for making the public API documentation and then seperate documentation for internal use by the package developers.

@jcollins-g
Copy link
Contributor Author

@BrennanGambling This is something we could do. It would have some impact on canonicalization and cross-linking between repos (because different runs of dartdoc with and without this flag would create different canonicalizations for different objects). Some loud warning to that effect if --link-to-remote is set seems like a good idea.

@rrousselGit
Copy link

I disagree here.
Testing APIs are public APIs.

I have packages which expose test-only APIs alongside other APIs. Those are intended to be used by users but just inside tests (due to being less safe and such).

An implicit nodoc here is counterproductive to that goal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
customer-flutter Issues originating from important to Flutter P2 A bug or feature request we're likely to work on type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

4 participants